radv: sync before resetting query pools if timestamps have been written
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 9 Oct 2019 12:30:49 +0000 (14:30 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 10 Oct 2019 11:23:20 +0000 (13:23 +0200)
Otherwise, the GPU might write timestamp queries after the reset
operation. This is similar to other query operations.

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

index ba9723244eede8869049a2d11101ebd60164b6b5..cafe02538649c3eb878c1fcbb77744a3dcffca49 100644 (file)
@@ -1773,5 +1773,15 @@ void radv_CmdWriteTimestamp(
                }
                query_va += pool->stride;
        }
+
+       cmd_buffer->active_query_flush_bits |= RADV_CMD_FLAG_PS_PARTIAL_FLUSH |
+                                              RADV_CMD_FLAG_CS_PARTIAL_FLUSH |
+                                              RADV_CMD_FLAG_INV_L2 |
+                                              RADV_CMD_FLAG_INV_VCACHE;
+       if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) {
+               cmd_buffer->active_query_flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB |
+                                                      RADV_CMD_FLAG_FLUSH_AND_INV_DB;
+       }
+
        assert(cmd_buffer->cs->cdw <= cdw_max);
 }