From: Marek Olšák Date: Sun, 11 Jun 2023 05:16:33 +0000 (-0400) Subject: amd: skip redundant PKT3_NUM_INSTANCES even with register shadowing X-Git-Tag: upstream/23.3.3~6855 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ce24402d6b8e5a00ddf5b1752101eb9a042b9a1;p=platform%2Fupstream%2Fmesa.git amd: skip redundant PKT3_NUM_INSTANCES even with register shadowing same as PAL Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 1d1ad47..1f400e7 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -8874,7 +8874,7 @@ radv_before_draw(struct radv_cmd_buffer *cmd_buffer, const struct radv_draw_info struct radv_cmd_state *state = &cmd_buffer->state; struct radeon_cmdbuf *cs = cmd_buffer->cs; assert(state->vtx_base_sgpr); - if (state->last_num_instances != info->instance_count || cmd_buffer->device->uses_shadow_regs) { + if (state->last_num_instances != info->instance_count) { radeon_emit(cs, PKT3(PKT3_NUM_INSTANCES, 0, false)); radeon_emit(cs, info->instance_count); state->last_num_instances = info->instance_count; diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp index 0d487d4..7ce80a4 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.cpp +++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp @@ -1630,9 +1630,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw radeon_emit(di_src_sel); } } else { - /* Register shadowing requires that we always emit PKT3_NUM_INSTANCES. */ - if (sctx->shadowing.registers || - sctx->last_instance_count == SI_INSTANCE_COUNT_UNKNOWN || + if (sctx->last_instance_count == SI_INSTANCE_COUNT_UNKNOWN || sctx->last_instance_count != instance_count) { radeon_emit(PKT3(PKT3_NUM_INSTANCES, 0, 0)); radeon_emit(instance_count);