anv: fix query clearing with blorp compute operations

If we did clear a query buffer in compute mode, the flushing needs to
match the engine used for clearing.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6823ffe70e ("anv: try to keep the pipeline in GPGPU mode when buffer transfer ops")
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28285>
This commit is contained in:
Lionel Landwerlin
2024-03-20 01:30:44 +02:00
committed by Marge Bot
parent b6c1390354
commit 983b62ea50
2 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -3170,7 +3170,7 @@ enum anv_query_bits {
*/
#define ANV_QUERY_RENDER_TARGET_WRITES_PENDING_BITS(devinfo) \
(((!ANV_DEVINFO_HAS_COHERENT_L3_CS(devinfo) && \
devinfo->ver >= 12) ? \
(devinfo)->ver >= 12) ? \
ANV_QUERY_WRITES_TILE_FLUSH : 0) | \
ANV_QUERY_WRITES_RT_FLUSH | \
ANV_QUERY_WRITES_CS_STALL)
+14 -5
View File
@@ -782,7 +782,9 @@ 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) {
/* Shader clearing is only possible on render/compute */
if (anv_cmd_buffer_is_render_or_compute_queue(cmd_buffer) &&
queryCount >= pdevice->instance->query_clear_with_blorp_threshold) {
trace_intel_begin_query_clear_blorp(&cmd_buffer->trace);
anv_cmd_buffer_fill_area(cmd_buffer,
@@ -790,10 +792,17 @@ void genX(CmdResetQueryPool)(
queryCount * pool->stride,
0);
cmd_buffer->state.queries.clear_bits =
(cmd_buffer->queue_family->queueFlags & VK_QUEUE_GRAPHICS_BIT) == 0 ?
ANV_QUERY_COMPUTE_WRITES_PENDING_BITS :
ANV_QUERY_RENDER_TARGET_WRITES_PENDING_BITS(cmd_buffer->device->info);
/* The pending clearing writes are in compute if we're in gpgpu mode on
* the render engine or on the compute engine.
*/
if (anv_cmd_buffer_is_compute_queue(cmd_buffer) ||
cmd_buffer->state.current_pipeline == pdevice->gpgpu_pipeline_value) {
cmd_buffer->state.queries.clear_bits =
ANV_QUERY_COMPUTE_WRITES_PENDING_BITS;
} else {
cmd_buffer->state.queries.clear_bits =
ANV_QUERY_RENDER_TARGET_WRITES_PENDING_BITS(&pdevice->info);
}
trace_intel_end_query_clear_blorp(&cmd_buffer->trace, queryCount);
return;