mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
venus: add a missing barrier before copying query feedback
The 1st sync scope of vkCmdCopyQueryPoolResults is not sufficient to
cover transfer writes against query feedback buffer. We must ensure
ordering against prior query reset cmd where the feedback buffer fill
gets injected.
Fixes: de4593faa1 ("venus: add query pool feedback cmds")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24130>
This commit is contained in:
parent
c4c258e19e
commit
ed79b30639
1 changed files with 19 additions and 0 deletions
|
|
@ -528,6 +528,25 @@ vn_feedback_query_copy_cmd_record(VkCommandBuffer cmd_handle,
|
|||
const size_t slot_size = (pool->result_array_size * 8) + 8;
|
||||
const size_t offset = slot_size * query;
|
||||
|
||||
/* The first synchronization scope of vkCmdCopyQueryPoolResults does not
|
||||
* include the query feedback buffer. Insert a barrier to ensure ordering
|
||||
* against feedback buffer fill cmd injected in vkCmdResetQueryPool.
|
||||
*/
|
||||
const VkBufferMemoryBarrier buf_barrier_before = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
|
||||
.pNext = NULL,
|
||||
.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
.buffer = pool->feedback->buffer,
|
||||
.offset = offset,
|
||||
.size = slot_size * count,
|
||||
};
|
||||
vn_CmdPipelineBarrier(cmd_handle, VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 1,
|
||||
&buf_barrier_before, 0, NULL);
|
||||
|
||||
/* Per spec: "The first synchronization scope includes all commands
|
||||
* which reference the queries in queryPool indicated by query that
|
||||
* occur earlier in submission order. If flags does not include
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue