Skip to content

Commit febac6d

Browse files
llandwerlin-intelMarge Bot
authored andcommitted
anv: fix query copy with shaders
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 <[email protected]> Cc: mesa-stable Reviewed-by: Ivan Briano <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37818>
1 parent c2d288b commit febac6d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/intel/vulkan/genX_query.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,8 +1859,12 @@ copy_query_results_with_shader(struct anv_cmd_buffer *cmd_buffer,
18591859
/* If this is the first command in the batch buffer, make sure we have
18601860
* consistent pipeline mode.
18611861
*/
1862-
if (cmd_buffer->state.current_pipeline == UINT32_MAX)
1863-
genX(flush_pipeline_select_3d)(cmd_buffer);
1862+
if (cmd_buffer->state.current_pipeline == UINT32_MAX) {
1863+
if (anv_cmd_buffer_is_render_queue(cmd_buffer))
1864+
genX(flush_pipeline_select_3d)(cmd_buffer);
1865+
else
1866+
genX(flush_pipeline_select_gpgpu)(cmd_buffer);
1867+
}
18641868

18651869
if ((cmd_buffer->state.queries.buffer_write_bits |
18661870
cmd_buffer->state.queries.clear_bits) & ANV_QUERY_WRITES_RT_FLUSH)
@@ -2029,7 +2033,8 @@ void genX(CmdCopyQueryPoolResults)(
20292033
struct anv_device *device = cmd_buffer->device;
20302034
struct anv_physical_device *pdevice = device->physical;
20312035

2032-
if (queryCount > pdevice->instance->query_copy_with_shader_threshold) {
2036+
if (queryCount > pdevice->instance->query_copy_with_shader_threshold &&
2037+
anv_cmd_buffer_is_render_or_compute_queue(cmd_buffer)) {
20332038
copy_query_results_with_shader(cmd_buffer, pool,
20342039
anv_address_add(buffer->address,
20352040
destOffset),

0 commit comments

Comments
 (0)