aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_readpixels.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_readpixels.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c b/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
index 687a49a57..425019dca 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/mesalib/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);