From: Marek Olšák Date: Sun, 4 Jan 2015 19:23:51 +0000 (+0100) Subject: radeonsi: remove flatshade from the shader key X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=15a7fff69a644856945f461e4b2c62c3a13872fb;p=mesa.git radeonsi: remove flatshade from the shader key Reviewed-by: Michel Dänzer --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 57a1e20ee0e..451eff11500 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -137,6 +137,7 @@ struct si_context { struct si_cs_shader_state cs_shader_state; /* shader information */ unsigned sprite_coord_enable; + bool flatshade; struct si_descriptors vertex_buffers; struct si_buffer_resources const_buffers[SI_NUM_SHADERS]; struct si_buffer_resources rw_buffers[SI_NUM_SHADERS]; diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 124615e19c6..21692f0ee33 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -123,7 +123,6 @@ union si_shader_key { unsigned last_cbuf:3; unsigned color_two_side:1; unsigned alpha_func:3; - unsigned flatshade:1; unsigned alpha_to_one:1; } ps; struct { diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 355f8aaf454..de12b4eeb15 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -362,7 +362,6 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx, if (sctx->queued.named.rasterizer) { key->ps.color_two_side = sctx->queued.named.rasterizer->two_side; - key->ps.flatshade = sctx->queued.named.rasterizer->flatshade; if (sctx->queued.named.blend) { key->ps.alpha_to_one = sctx->queued.named.blend->alpha_to_one && @@ -632,10 +631,8 @@ bcolor: tmp = 0; if (interpolate == TGSI_INTERPOLATE_CONSTANT || - (interpolate == TGSI_INTERPOLATE_COLOR && - ps->key.ps.flatshade)) { + (interpolate == TGSI_INTERPOLATE_COLOR && sctx->flatshade)) tmp |= S_028644_FLAT_SHADE(1); - } if (name == TGSI_SEMANTIC_GENERIC && sctx->sprite_coord_enable & (1 << index)) { @@ -711,6 +708,7 @@ static void si_init_gs_rings(struct si_context *sctx) void si_update_shaders(struct si_context *sctx) { struct pipe_context *ctx = (struct pipe_context*)sctx; + struct si_state_rasterizer *rs = sctx->queued.named.rasterizer; if (sctx->gs_shader) { si_shader_select(ctx, sctx->gs_shader); @@ -776,8 +774,10 @@ void si_update_shaders(struct si_context *sctx) si_pm4_bind_state(sctx, ps, sctx->ps_shader->current->pm4); if (si_pm4_state_changed(sctx, ps) || si_pm4_state_changed(sctx, vs) || - sctx->sprite_coord_enable != sctx->queued.named.rasterizer->sprite_coord_enable) { - sctx->sprite_coord_enable = sctx->queued.named.rasterizer->sprite_coord_enable; + sctx->sprite_coord_enable != rs->sprite_coord_enable || + sctx->flatshade != rs->flatshade) { + sctx->sprite_coord_enable = rs->sprite_coord_enable; + sctx->flatshade = rs->flatshade; si_update_spi_map(sctx); }