diff options
author | Marek Olšák <[email protected]> | 2013-03-28 01:56:01 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-04-06 23:57:06 +0200 |
commit | 755648c37fc7a54ed0b11c868fd4c7fe28b2f861 (patch) | |
tree | af74440ff60de156f3f19b7ddcea229b686a063c /src/mesa/state_tracker | |
parent | 21d407c1b8bf3be1eff87121d528d03c240ce207 (diff) |
mesa: don't set _ClampFragmentColor to TRUE if it has no effect
This should reduce shader recompilations with drivers that emulate fragment
color clamping, because we want the clamping to be enabled only if there is
a signed normalized or floating-point colorbuffer.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 6 |
4 files changed, 5 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 866e5627d7f..62464b4750b 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -227,8 +227,7 @@ static void update_raster_state( struct st_context *st ) /* _NEW_FRAG_CLAMP */ raster->clamp_fragment_color = !st->clamp_frag_color_in_shader && - ctx->Color._ClampFragmentColor && - !ctx->DrawBuffer->_IntegerColor; + ctx->Color._ClampFragmentColor; raster->gl_rasterization_rules = 1; /* _NEW_RASTERIZER_DISCARD */ diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index c1d7c80bb3a..c0239e9297c 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -86,8 +86,7 @@ update_fp( struct st_context *st ) /* _NEW_FRAG_CLAMP */ key.clamp_color = st->clamp_frag_color_in_shader && - st->ctx->Color._ClampFragmentColor && - !st->ctx->DrawBuffer->_IntegerColor; + st->ctx->Color._ClampFragmentColor; st->fp_variant = st_get_fp_variant(st, stfp, &key); diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 05138146ab4..b3ca4050102 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -417,8 +417,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, key.st = st; key.bitmap = GL_TRUE; key.clamp_color = st->clamp_frag_color_in_shader && - st->ctx->Color._ClampFragmentColor && - !st->ctx->DrawBuffer->_IntegerColor; + st->ctx->Color._ClampFragmentColor; fpv = st_get_fp_variant(st, st->fp, &key); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index b25b77629f3..f5a1e27f79b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -710,8 +710,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, struct pipe_rasterizer_state rasterizer; memset(&rasterizer, 0, sizeof(rasterizer)); rasterizer.clamp_fragment_color = !st->clamp_frag_color_in_shader && - ctx->Color._ClampFragmentColor && - !ctx->DrawBuffer->_IntegerColor; + ctx->Color._ClampFragmentColor; rasterizer.gl_rasterization_rules = 1; rasterizer.depth_clip = !ctx->Transform.DepthClamp; rasterizer.scissor = ctx->Scissor.Enabled; @@ -1037,8 +1036,7 @@ get_color_fp_variant(struct st_context *st) ctx->Pixel.AlphaScale != 1.0); key.pixelMaps = ctx->Pixel.MapColorFlag; key.clamp_color = st->clamp_frag_color_in_shader && - st->ctx->Color._ClampFragmentColor && - !st->ctx->DrawBuffer->_IntegerColor; + st->ctx->Color._ClampFragmentColor; fpv = st_get_fp_variant(st, st->fp, &key); |