summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-02-26 08:20:38 -0700
committerBrian Paul <[email protected]>2013-02-26 09:16:52 -0700
commite2148ab0438a670e1ce1068fe40346faa4e50598 (patch)
tree7eb85113bd0a3260d316fea1488c7687ab046a85 /src/mesa
parente5e4c07e7964a3258ed02b530bcdc24c0650204b (diff)
st/mesa: remove some conditionals in update_raster_state()
Just use simple assignments. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 7fdfa727017..0e2a152cd57 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -84,11 +84,10 @@ static void update_raster_state( struct st_context *st )
/* _NEW_LIGHT
*/
- if (ctx->Light.ShadeModel == GL_FLAT)
- raster->flatshade = 1;
-
- if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION_EXT)
- raster->flatshade_first = 1;
+ raster->flatshade = ctx->Light.ShadeModel == GL_FLAT;
+
+ raster->flatshade_first = ctx->Light.ProvokingVertex ==
+ GL_FIRST_VERTEX_CONVENTION_EXT;
/* _NEW_LIGHT | _NEW_PROGRAM */
raster->light_twoside = ctx->VertexProgram._TwoSideEnabled;
@@ -145,18 +144,13 @@ static void update_raster_state( struct st_context *st )
raster->offset_scale = ctx->Polygon.OffsetFactor;
}
- if (ctx->Polygon.SmoothFlag)
- raster->poly_smooth = 1;
-
- if (ctx->Polygon.StippleFlag)
- raster->poly_stipple_enable = 1;
+ raster->poly_smooth = ctx->Polygon.SmoothFlag;
+ raster->poly_stipple_enable = ctx->Polygon.StippleFlag;
/* _NEW_POINT
*/
raster->point_size = ctx->Point.Size;
-
- if (!ctx->Point.PointSprite && ctx->Point.SmoothFlag)
- raster->point_smooth = 1;
+ raster->point_smooth = !ctx->Point.PointSprite && ctx->Point.SmoothFlag;
/* _NEW_POINT | _NEW_PROGRAM
*/
@@ -229,8 +223,7 @@ static void update_raster_state( struct st_context *st )
raster->multisample = ctx->Multisample._Enabled;
/* _NEW_SCISSOR */
- if (ctx->Scissor.Enabled)
- raster->scissor = 1;
+ raster->scissor = ctx->Scissor.Enabled;
/* _NEW_FRAG_CLAMP */
raster->clamp_fragment_color = !st->clamp_frag_color_in_shader &&