diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_atom_blend.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_depth.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_readpixels.c | 7 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 7 |
7 files changed, 24 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_atom_blend.c b/src/mesa/state_tracker/st_atom_blend.c index fb1c7a4efee..d1844e1066f 100644 --- a/src/mesa/state_tracker/st_atom_blend.c +++ b/src/mesa/state_tracker/st_atom_blend.c @@ -286,7 +286,7 @@ update_blend( struct st_context *st ) { struct pipe_blend_color bc; - COPY_4FV(bc.color, st->ctx->Color.BlendColor); + COPY_4FV(bc.color, st->ctx->Color.BlendColorUnclamped); cso_set_blend_color(st->cso_context, &bc); } } diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index aaee432a216..6c51b1ac1a2 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -142,7 +142,7 @@ update_depth_stencil_alpha(struct st_context *st) if (ctx->Color.AlphaEnabled) { dsa->alpha.enabled = 1; dsa->alpha.func = st_compare_func_to_pipe(ctx->Color.AlphaFunc); - dsa->alpha.ref_value = ctx->Color.AlphaRef; + dsa->alpha.ref_value = ctx->Color.AlphaRefUnclamped; } cso_set_depth_stencil_alpha(st->cso_context, dsa); diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 8bccceeec53..250cbb2260c 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -112,6 +112,8 @@ static void update_raster_state( struct st_context *st ) raster->light_twoside = 1; } + raster->clamp_vertex_color = ctx->Light._ClampVertexColor; + /* _NEW_POLYGON */ if (ctx->Polygon.CullFlag) { @@ -252,6 +254,9 @@ static void update_raster_state( struct st_context *st ) if (ctx->Scissor.Enabled) raster->scissor = 1; + /* _NEW_FRAG_CLAMP */ + raster->clamp_fragment_color = ctx->Color._ClampFragmentColor; + raster->gl_rasterization_rules = 1; cso_set_rasterizer(st->cso_context, raster); @@ -267,7 +272,8 @@ const struct st_tracked_state st_update_rasterizer = { _NEW_POINT | _NEW_POLYGON | _NEW_PROGRAM | - _NEW_SCISSOR), /* mesa state dependencies*/ + _NEW_SCISSOR | + _NEW_FRAG_CLAMP), /* mesa state dependencies*/ ST_NEW_VERTEX_PROGRAM, /* state tracker dependencies */ }, update_raster_state /* update function */ diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 1eb748e0d5d..181fedd2b99 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -323,7 +323,7 @@ clear_with_quad(struct gl_context *ctx, set_vertex_shader(st); if (ctx->DrawBuffer->_ColorDrawBuffers[0]) { - st_translate_color(ctx->Color.ClearColor, + st_translate_color(ctx->Color.ClearColorUnclamped, ctx->DrawBuffer->_ColorDrawBuffers[0]->_BaseFormat, clearColor); } @@ -585,7 +585,7 @@ st_Clear(struct gl_context *ctx, GLbitfield mask) clearColor); } - st->pipe->clear(st->pipe, clear_buffers, ctx->Color.ClearColor, + st->pipe->clear(st->pipe, clear_buffers, ctx->Color.ClearColorUnclamped, ctx->Depth.Clear, ctx->Stencil.Clear); } if (mask & BUFFER_BIT_ACCUM) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index eccc207579b..dc53e276cb3 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -582,6 +582,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 = ctx->Color._ClampFragmentColor; rasterizer.gl_rasterization_rules = 1; rasterizer.scissor = ctx->Scissor.Enabled; cso_set_rasterizer(cso, &rasterizer); diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index f8da2a4d158..03f58bf0fc4 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -331,7 +331,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; GLfloat (*temp)[4]; - const GLbitfield transferOps = ctx->_ImageTransferState; + GLbitfield transferOps = ctx->_ImageTransferState; GLsizei i, j; GLint yStep, dfStride; GLfloat *df; @@ -391,7 +391,10 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei h return; } - if (format == GL_RGBA && type == GL_FLOAT) { + if(ctx->Color._ClampReadColor) + transferOps |= IMAGE_CLAMP_BIT; + + if (format == GL_RGBA && type == GL_FLOAT && !transferOps) { /* write tile(row) directly into user's buffer */ df = (GLfloat *) _mesa_image_address2d(&clippedPacking, dest, width, height, format, type, 0, 0); diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index bbcae3b02e9..89bb03046c1 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -508,6 +508,13 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.ARB_depth_clamp = GL_TRUE; } + /* this extension does not actually require support of floating point + * render targets, just clamping controls + */ + if(screen->get_param(screen, PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL) && + screen->get_param(screen, PIPE_CAP_VERTEX_COLOR_CLAMP_CONTROL)) + ctx->Extensions.ARB_color_buffer_float = GL_TRUE; + if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { ctx->Extensions.ARB_shader_stencil_export = GL_TRUE; } |