amd: skip redundant PKT3_NUM_INSTANCES even with register shadowing
authorMarek Olšák <marek.olsak@amd.com>
Sun, 11 Jun 2023 05:16:33 +0000 (01:16 -0400)
committerMarge Bot <emma+marge@anholt.net>
Sat, 17 Jun 2023 23:42:21 +0000 (23:42 +0000)
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>

src/amd/vulkan/radv_cmd_buffer.c
src/gallium/drivers/radeonsi/si_state_draw.cpp

index 1d1ad47..1f400e7 100644 (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;
index 0d487d4..7ce80a4 100644 (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);