summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_readpixels.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2011-02-16 00:14:49 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-29 12:04:55 +0200
commit47e3896dfd89a26abbe4ca2469c2480f3982b204 (patch)
tree3f64fd4340c66ee84da89506afd92c1f29f6dbb7 /src/mesa/state_tracker/st_cb_readpixels.c
parente5c6a92a12b5cd7db205d72039f58d302b0be9d5 (diff)
downloadexternal_mesa3d-47e3896dfd89a26abbe4ca2469c2480f3982b204.zip
external_mesa3d-47e3896dfd89a26abbe4ca2469c2480f3982b204.tar.gz
external_mesa3d-47e3896dfd89a26abbe4ca2469c2480f3982b204.tar.bz2
gallium: implement clamping controls (ARB_color_buffer_float)
BTW this changes the gallium interface. Some rather cosmetic changes by Marek. Squashed commit of the following: commit 513b37d484f0318311e84bb86ed4c93cdff71f13 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:17:54 2010 +0200 mesa/st: respect fragment clamping in st_DrawPixels commit 546a31e42cad459d7a7a10ebf77fc5ffcf89e9b8 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:17:28 2010 +0200 mesa/st: support fragment and vertex color clamping commit c406514a1fbee6891da4cf9ac3eebe4e4407ec13 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Tue Aug 24 21:56:37 2010 +0200 mesa/st: expose ARB_color_buffer_float if unclamping is supported commit d0c5ea11b6f75f3da2f4ca989115f150ebc7cf8d Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 17:53:41 2010 +0200 mesa/st: use unclamped colors This assumes that Gallium is to be interpreted as given drivers the responsibility to clamp these colors if necessary. commit aef5c3c6be6edd076e955e37c80905bc447f8a82 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:12:34 2010 +0200 mesa, mesa/st: handle read color clamping properly We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where the operation mandates it. (see the removed XXX comment. -Marek) TODO: did I get the set of operations mandating it right? commit 76bdfcfe3ff4145a1818e6cb6e227b730a5f12d8 Author: Luca Barbieri <luca@luca-barbieri.com> Date: Thu Aug 26 18:18:25 2010 +0200 gallium: add color clamping to the interface
Diffstat (limited to 'src/mesa/state_tracker/st_cb_readpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index f8da2a4..03f58bf 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);