amd: skip redundant PKT3_NUM_INSTANCES even with register shadowing

same as PAL

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23687>
This commit is contained in:
Marek Olšák 2023-06-11 01:16:33 -04:00 committed by Marge Bot
parent 6349d3f537
commit 2ce24402d6
2 changed files with 2 additions and 4 deletions

View file

@ -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;

View file

@ -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);