From: Marek Olšák Date: Sat, 15 Aug 2020 06:48:13 +0000 (-0400) Subject: radeonsi: simplify handling color interp modes in si_emit_spi_map X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=14391533f81e537b6a9fa545019aa6ef0bea7597;p=mesa.git radeonsi: simplify handling color interp modes in si_emit_spi_map Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 2c285c09f5d..de807fa148e 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -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);