radv: reset pending_reset_query when flushing caches
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 5 Dec 2018 10:34:39 +0000 (11:34 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 5 Dec 2018 12:05:55 +0000 (13:05 +0100)
If the driver used a compute shader for resetting a query pool,
it should be completed when caches are flushed.

This might reduce the number of stalls if operations are done
between vkCmdResetQueryPool() and vkCmdBeginQuery()
(or vkCmdWriteTimestamp()).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Smith <asmith@feralinteractive.com>
src/amd/vulkan/radv_query.c
src/amd/vulkan/si_cmd_buffer.c

index e226bcef6a9135640926acef388fb3dddda8333f..276cc1c42d7907ac9721ddf796879506c282e73d 100644 (file)
@@ -1447,7 +1447,6 @@ static void emit_query_flush(struct radv_cmd_buffer *cmd_buffer,
                         * because we use a CP dma clear.
                         */
                        si_emit_cache_flush(cmd_buffer);
-                       cmd_buffer->pending_reset_query = false;
                }
        }
 }
index a9f25725415266d5cbceb544ba2fab09e600c0b6..2f57584bf82106ac9e375bc0e3af0f3d12f2d74f 100644 (file)
@@ -992,6 +992,11 @@ si_emit_cache_flush(struct radv_cmd_buffer *cmd_buffer)
                radv_cmd_buffer_trace_emit(cmd_buffer);
 
        cmd_buffer->state.flush_bits = 0;
+
+       /* If the driver used a compute shader for resetting a query pool, it
+        * should be finished at this point.
+        */
+       cmd_buffer->pending_reset_query = false;
 }
 
 /* sets the CP predication state using a boolean stored at va */