anv: exclude performance queries from blorp clears
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 11 Apr 2023 18:15:13 +0000 (21:15 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 13 Apr 2023 00:44:29 +0000 (00:44 +0000)
The query buffer contains a batch to implement the multi pass
replay/accumulation of results. So we can't clear it with a memset.

An optimization for later would be to move the batches to the very end
of the query buffer so we can clear the query data without touching
the batches.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4dc7256bf962 ("anv: reset query pools using blorp")
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22421>

src/intel/vulkan/genX_query.c

index 0f913c5..fdfd105 100644 (file)
@@ -784,7 +784,8 @@ void genX(CmdResetQueryPool)(
    ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
    struct anv_physical_device *pdevice = cmd_buffer->device->physical;
 
-   if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold) {
+   if (queryCount >= pdevice->instance->query_clear_with_blorp_threshold &&
+       pool->type != VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR) {
       anv_cmd_buffer_fill_area(cmd_buffer,
                                anv_query_address(pool, firstQuery),
                                queryCount * pool->stride,