Module: Mesa Branch: main Commit: 8dafda4a07c408e04ebd19acaca794feaf681d8d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8dafda4a07c408e04ebd19acaca794feaf681d8d
Author: Samuel Pitoiset <[email protected]> Date: Mon Oct 31 13:51:00 2022 +0100 radv: suspend/resume primitives generated query separately for legacy/NGG With NGG only, only the GDS query counter will be incremented. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19410> --- src/amd/vulkan/radv_meta.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index 0e970b75fb2..ca4c30f119b 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -51,14 +51,14 @@ radv_suspend_queries(struct radv_meta_saved_state *state, struct radv_cmd_buffer radv_set_db_count_control(cmd_buffer, false); } - /* Primitives generated queries. */ + /* Primitives generated queries (legacy). */ if (cmd_buffer->state.active_prims_gen_queries) { cmd_buffer->state.suspend_streamout = true; radv_emit_streamout_enable(cmd_buffer); + } - /* Save the number of active GDS queries and reset it to make sure internal operations won't - * increment the counters via GDS. - */ + /* Primitives generated queries (NGG). */ + if (cmd_buffer->state.active_prims_gen_gds_queries) { state->active_prims_gen_gds_queries = cmd_buffer->state.active_prims_gen_gds_queries; cmd_buffer->state.active_prims_gen_gds_queries = 0; } @@ -80,12 +80,14 @@ radv_resume_queries(const struct radv_meta_saved_state *state, struct radv_cmd_b radv_set_db_count_control(cmd_buffer, true); } - /* Primitives generated queries. */ + /* Primitives generated queries (legacy). */ if (cmd_buffer->state.active_prims_gen_queries) { cmd_buffer->state.suspend_streamout = false; radv_emit_streamout_enable(cmd_buffer); + } - /* Restore the number of active GDS queries to resume counting. */ + /* Primitives generated queries (NGG). */ + if (state->active_prims_gen_gds_queries) { cmd_buffer->state.active_prims_gen_gds_queries = state->active_prims_gen_gds_queries; } } @@ -103,6 +105,7 @@ radv_meta_save(struct radv_meta_saved_state *state, struct radv_cmd_buffer *cmd_ assert(flags & (RADV_META_SAVE_GRAPHICS_PIPELINE | RADV_META_SAVE_COMPUTE_PIPELINE)); state->flags = flags; + state->active_prims_gen_gds_queries = 0; if (state->flags & RADV_META_SAVE_GRAPHICS_PIPELINE) { assert(!(state->flags & RADV_META_SAVE_COMPUTE_PIPELINE));
