<div dir="ltr">Reviewed-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com">asmith@feralinteractive.com</a>></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 5 Dec 2018 at 10:32, Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If the driver used a compute shader for resetting a query pool,<br>
it should be completed when caches are flushed.<br>
<br>
This might reduce the number of stalls if operations are done<br>
between vkCmdResetQueryPool() and vkCmdBeginQuery()<br>
(or vkCmdWriteTimestamp()).<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>><br>
---<br>
 src/amd/vulkan/radv_query.c    | 1 -<br>
 src/amd/vulkan/si_cmd_buffer.c | 5 +++++<br>
 2 files changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c<br>
index e226bcef6a9..276cc1c42d7 100644<br>
--- a/src/amd/vulkan/radv_query.c<br>
+++ b/src/amd/vulkan/radv_query.c<br>
@@ -1447,7 +1447,6 @@ static void emit_query_flush(struct radv_cmd_buffer *cmd_buffer,<br>
                         * because we use a CP dma clear.<br>
                         */<br>
                        si_emit_cache_flush(cmd_buffer);<br>
-                       cmd_buffer->pending_reset_query = false;<br>
                }<br>
        }<br>
 }<br>
diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c<br>
index a9f25725415..2f57584bf82 100644<br>
--- a/src/amd/vulkan/si_cmd_buffer.c<br>
+++ b/src/amd/vulkan/si_cmd_buffer.c<br>
@@ -992,6 +992,11 @@ si_emit_cache_flush(struct radv_cmd_buffer *cmd_buffer)<br>
                radv_cmd_buffer_trace_emit(cmd_buffer);<br>
<br>
        cmd_buffer->state.flush_bits = 0;<br>
+<br>
+       /* If the driver used a compute shader for resetting a query pool, it<br>
+        * should be finished at this point.<br>
+        */<br>
+       cmd_buffer->pending_reset_query = false;<br>
 }<br>
<br>
 /* sets the CP predication state using a boolean stored at va */<br>
-- <br>
2.19.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>