mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
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 <anuj.phogat@gmail.com> Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
7974e23be9
commit
1252d53c19
1 changed files with 9 additions and 4 deletions
|
|
@ -273,12 +273,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue