radeonsi: simplify handling color interp modes in si_emit_spi_map
authorMarek Olšák <marek.olsak@amd.com>
Sat, 15 Aug 2020 06:48:13 +0000 (02:48 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 3 Sep 2020 03:03:00 +0000 (23:03 -0400)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6340>

src/gallium/drivers/radeonsi/si_state_shaders.c

index 2c285c09f5dad06a4496aa19f97af5eee267ad37..de807fa148e570cf2ebb7a5dfdfc534ea034a1db 100644 (file)
@@ -3247,7 +3247,7 @@ static void si_emit_spi_map(struct si_context *sctx)
    struct si_shader *ps = sctx->ps_shader.current;
    struct si_shader *vs = si_get_vs_state(sctx);
    struct si_shader_info *psinfo = ps ? &ps->selector->info : NULL;
-   unsigned i, num_interp, num_written = 0, bcol_interp[2];
+   unsigned i, num_interp, num_written = 0;
    unsigned spi_ps_input_cntl[32];
 
    if (!ps || !ps->selector->info.num_inputs)
@@ -3262,11 +3262,6 @@ static void si_emit_spi_map(struct si_context *sctx)
       unsigned interpolate = psinfo->input_interpolate[i];
 
       spi_ps_input_cntl[num_written++] = si_get_ps_input_cntl(sctx, vs, name, index, interpolate);
-
-      if (name == TGSI_SEMANTIC_COLOR) {
-         assert(index < ARRAY_SIZE(bcol_interp));
-         bcol_interp[index] = interpolate;
-      }
    }
 
    if (ps->key.part.ps.prolog.color_two_side) {
@@ -3276,7 +3271,8 @@ static void si_emit_spi_map(struct si_context *sctx)
          if (!(psinfo->colors_read & (0xf << (i * 4))))
             continue;
 
-         spi_ps_input_cntl[num_written++] = si_get_ps_input_cntl(sctx, vs, bcol, i, bcol_interp[i]);
+         spi_ps_input_cntl[num_written++] = si_get_ps_input_cntl(sctx, vs, bcol, i,
+                                                                 psinfo->color_interpolate[i]);
       }
    }
    assert(num_interp == num_written);