anv: fix query copy with shaders
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

First this is only possible on RCS or CCS engines.

Second if on CCS, we need to use a compute shader, 3D won't work.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37818>
This commit is contained in:
Lionel Landwerlin 2025-10-10 17:00:47 +03:00 committed by Marge Bot
parent c2d288bf97
commit febac6d9bd

View file

@ -1859,8 +1859,12 @@ copy_query_results_with_shader(struct anv_cmd_buffer *cmd_buffer,
/* If this is the first command in the batch buffer, make sure we have
* consistent pipeline mode.
*/
if (cmd_buffer->state.current_pipeline == UINT32_MAX)
genX(flush_pipeline_select_3d)(cmd_buffer);
if (cmd_buffer->state.current_pipeline == UINT32_MAX) {
if (anv_cmd_buffer_is_render_queue(cmd_buffer))
genX(flush_pipeline_select_3d)(cmd_buffer);
else
genX(flush_pipeline_select_gpgpu)(cmd_buffer);
}
if ((cmd_buffer->state.queries.buffer_write_bits |
cmd_buffer->state.queries.clear_bits) & ANV_QUERY_WRITES_RT_FLUSH)
@ -2029,7 +2033,8 @@ void genX(CmdCopyQueryPoolResults)(
struct anv_device *device = cmd_buffer->device;
struct anv_physical_device *pdevice = device->physical;
if (queryCount > pdevice->instance->query_copy_with_shader_threshold) {
if (queryCount > pdevice->instance->query_copy_with_shader_threshold &&
anv_cmd_buffer_is_render_or_compute_queue(cmd_buffer)) {
copy_query_results_with_shader(cmd_buffer, pool,
anv_address_add(buffer->address,
destOffset),