diff options
author | Anuj Phogat <[email protected]> | 2015-05-20 10:21:39 -0700 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-08-01 16:27:39 +0100 |
commit | acaac69ccd3d8d70044aab98dbadc5b177510eb5 (patch) | |
tree | cecb419683fe426b89e568415910d5dadfd154b5 /src | |
parent | fbc464803a777bea4f9b7b11eeba192122adf8cb (diff) |
meta: Fix transfer operations check in meta pbo path for readpixels
Currently used ctx->_ImageTransferState check is not sufficient
because it doesn't include the read color clamping enabled with
GL_CLAMP_READ_COLOR. So, use the helper function
_mesa_get_readpixels_transfer_ops().
Also, transfer operations don't affect glGetTexImage(). So, do
the check only for glReadPixles.
Without this patch, arb_color_buffer_float-readpixels test fails, when
forced to use meta pbo path.
V2: Add a comment and bump up the commit message.
Signed-off-by: Anuj Phogat <[email protected]>
Cc: <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
(cherry picked from commit 1252d53c19ec005c17ca666cecb7db072d77e5ce)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta_tex_subimage.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c index 6bd74e126f2..d2552c4425d 100644 --- a/src/mesa/drivers/common/meta_tex_subimage.c +++ b/src/mesa/drivers/common/meta_tex_subimage.c @@ -272,12 +272,17 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims, format == GL_COLOR_INDEX) return false; - if (ctx->_ImageTransferState) - return false; - - + /* Don't use meta path for readpixels in below conditions. */ if (!tex_image) { rb = ctx->ReadBuffer->_ColorReadBuffer; + + /* _mesa_get_readpixels_transfer_ops() includes the cases of read + * color clamping along with the ctx->_ImageTransferState. + */ + if (_mesa_get_readpixels_transfer_ops(ctx, rb->Format, format, + type, GL_FALSE)) + return false; + if (_mesa_need_rgb_to_luminance_conversion(rb->Format, format)) return false; } |