turnip: flush cache for dstBuffer in vkCmdCopyQueryPoolResults

There can be other writes to the dstBuffer gated by proper barriers
beforehand.

TEST=dEQP-VK.pipeline.*.timestamp.* with Venus on Turnip

Fixes: 487aa807bd ("tu: Rewrite flushing to use barriers")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24245>
(cherry picked from commit a89752d630)
This commit is contained in:
Yiwei Zhang 2023-07-19 23:10:22 +00:00 committed by Eric Engestrom
parent c1ac43503e
commit 3ed532d994
4 changed files with 8 additions and 2 deletions

View file

@ -517,7 +517,7 @@
"description": "turnip: flush cache for dstBuffer in vkCmdCopyQueryPoolResults",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "487aa807bd1b70602fcb6fbdabd101d4cff7c07b"
},

View file

@ -182,7 +182,7 @@ tu6_emit_flushes(struct tu_cmd_buffer *cmd_buffer,
}
/* "Normal" cache flushes outside the renderpass, that don't require any special handling */
static void
void
tu_emit_cache_flush(struct tu_cmd_buffer *cmd_buffer)
{
tu6_emit_flushes(cmd_buffer, &cmd_buffer->cs, &cmd_buffer->state.cache);

View file

@ -640,6 +640,9 @@ void tu_render_pass_state_merge(struct tu_render_pass_state *dst,
VkResult tu_cmd_buffer_begin(struct tu_cmd_buffer *cmd_buffer,
const VkCommandBufferBeginInfo *pBeginInfo);
void
tu_emit_cache_flush(struct tu_cmd_buffer *cmd_buffer);
void tu_emit_cache_flush_renderpass(struct tu_cmd_buffer *cmd_buffer);
void tu_emit_cache_flush_ccu(struct tu_cmd_buffer *cmd_buffer,

View file

@ -614,6 +614,9 @@ emit_copy_query_pool_results(struct tu_cmd_buffer *cmdbuf,
VkDeviceSize stride,
VkQueryResultFlags flags)
{
/* Flush cache for the buffer to copy to. */
tu_emit_cache_flush(cmdbuf);
/* From the Vulkan 1.1.130 spec:
*
* vkCmdCopyQueryPoolResults is guaranteed to see the effect of previous