amd: skip redundant INDEX_TYPE 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 1f400e7..7daf7c2 100644 (file)
@@ -5293,7 +5293,7 @@ radv_emit_draw_registers(struct radv_cmd_buffer *cmd_buffer, const struct radv_d
       disable_instance_packing = true;
    }
 
-   if ((draw_info->indexed && (state->index_type != state->last_index_type || cmd_buffer->device->uses_shadow_regs)) ||
+   if ((draw_info->indexed && state->index_type != state->last_index_type) ||
        (info->gfx_level == GFX10_3 &&
         (state->last_index_type == -1 ||
          disable_instance_packing != G_028A7C_DISABLE_INSTANCE_PACKING(state->last_index_type)))) {
index 7ce80a4..cc80c9c 100644 (file)
@@ -1504,7 +1504,7 @@ static void si_emit_draw_packets(struct si_context *sctx, const struct pipe_draw
    /* draw packet */
    if (index_size) {
       /* Register shadowing doesn't shadow INDEX_TYPE. */
-      if (index_size != sctx->last_index_size || sctx->shadowing.registers ||
+      if (index_size != sctx->last_index_size ||
           (GFX_VERSION == GFX10_3 && disable_instance_packing != sctx->disable_instance_packing)) {
          unsigned index_type;