summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_rasterizer.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-01-23 03:11:17 +0100
committerMarek Olšák <[email protected]>2012-01-25 12:35:18 +0100
commitbc1c8369384b5e16547c5bf9728aa78f8dfd66cc (patch)
treea09267d88b2c604491a607467e28a7f8fbae4146 /src/mesa/state_tracker/st_atom_rasterizer.c
parentc2e2b58a58880c9b9f189fc154205e99144e9502 (diff)
st/mesa: do vertex and fragment color clamping in shaders
For ARB_color_buffer_float. Most hardware can't do it and st/mesa is the perfect place for a fallback. The exceptions are: - r500 (vertex clamp only) - nv50 (both) - nvc0 (both) - softpipe (both) We also have to take into account that r300 can do CLAMPED vertex colors only, while r600 can do UNCLAMPED vertex colors only. The difference can be expressed with the two new CAPs.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_rasterizer.c')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index f3d28e675f5..25799bf2bd5 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -112,7 +112,8 @@ static void update_raster_state( struct st_context *st )
raster->light_twoside = 1;
}
- raster->clamp_vertex_color = ctx->Light._ClampVertexColor;
+ raster->clamp_vertex_color = !st->clamp_vert_color_in_shader &&
+ ctx->Light._ClampVertexColor;
/* _NEW_POLYGON
*/
@@ -255,7 +256,8 @@ static void update_raster_state( struct st_context *st )
raster->scissor = 1;
/* _NEW_FRAG_CLAMP */
- raster->clamp_fragment_color = ctx->Color._ClampFragmentColor;
+ raster->clamp_fragment_color = !st->clamp_frag_color_in_shader &&
+ ctx->Color._ClampFragmentColor;
raster->gl_rasterization_rules = 1;
/* _NEW_RASTERIZER_DISCARD */