st/mesa: don't clamp fragment color with integer colorbuffer
authorMarek Olšák <maraeo@gmail.com>
Sat, 4 Aug 2012 11:32:21 +0000 (13:32 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 15 Aug 2012 17:20:57 +0000 (19:20 +0200)
src/mesa/state_tracker/st_atom_rasterizer.c
src/mesa/state_tracker/st_atom_shader.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_drawpixels.c

index 204f505a69f9ea4578b02c5da50e6a2a9e355016..d9e9d21f688c73e0715acab02187a0feb38f82a7 100644 (file)
@@ -239,7 +239,8 @@ 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->Color._ClampFragmentColor &&
+                                  !ctx->DrawBuffer->_IntegerColor;
    raster->gl_rasterization_rules = 1;
 
    /* _NEW_RASTERIZER_DISCARD */
index ae3491097b41a4ac52dcdd369456b86a08c9623e..45e7a117f5c3b5e4d778b2e78b7658b9d73a6f73 100644 (file)
@@ -85,7 +85,8 @@ update_fp( struct st_context *st )
 
    /* _NEW_FRAG_CLAMP */
    key.clamp_color = st->clamp_frag_color_in_shader &&
-                     st->ctx->Color._ClampFragmentColor;
+                     st->ctx->Color._ClampFragmentColor &&
+                     !st->ctx->DrawBuffer->_IntegerColor;
 
    st->fp_variant = st_get_fp_variant(st, stfp, &key);
 
@@ -106,7 +107,7 @@ update_fp( struct st_context *st )
 const struct st_tracked_state st_update_fp = {
    "st_update_fp",                                     /* name */
    {                                                   /* dirty */
-      0,                                               /* mesa */
+      _NEW_BUFFERS,                                    /* mesa */
       ST_NEW_FRAGMENT_PROGRAM                           /* st */
    },
    update_fp                                   /* update */
index 3c17bd6c359fed7fd6eea9bb4fc323bb0f6c2817..7d9ccc1e5a05964b77a12025d655a0c6c307dc43 100644 (file)
@@ -424,7 +424,8 @@ 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->Color._ClampFragmentColor &&
+                     !st->ctx->DrawBuffer->_IntegerColor;
 
    fpv = st_get_fp_variant(st, st->fp, &key);
 
index 88068ac6078647696c26c3276bc757719368baea..9f1b427a9407bb4d593a2a22c8aa4eb13497155f 100644 (file)
@@ -697,7 +697,8 @@ 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->Color._ClampFragmentColor &&
+                                        !ctx->DrawBuffer->_IntegerColor;
       rasterizer.gl_rasterization_rules = 1;
       rasterizer.depth_clip = !ctx->Transform.DepthClamp;
       rasterizer.scissor = ctx->Scissor.Enabled;
@@ -1026,7 +1027,8 @@ 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->Color._ClampFragmentColor &&
+                     !st->ctx->DrawBuffer->_IntegerColor;
 
    fpv = st_get_fp_variant(st, st->fp, &key);