summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-06-12 14:42:57 -0700
committerAnuj Phogat <[email protected]>2015-07-24 10:48:58 -0700
commit4b8745680ff45cd7adc7896c06263e14b8d347ce (patch)
tree51f428050e5c6f2e64bcc4260082a30369c34272 /src/mesa/drivers/common
parentaa40546b2de4cd572af02d31fd5c7d4045505ea2 (diff)
mesa: Change the signature of _mesa_need_rgb_to_luminance_conversion()
This allows us to handle cases when texImage->_BaseFormat doesn't match _mesa_format_get_base_format(texImage->Format). _BaseFormat is what we care about in this function. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta_tex_subimage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 8c0a50984d2..16d8f5d4747 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -280,6 +280,7 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
int full_height, image_height;
struct gl_texture_image *pbo_tex_image;
struct gl_renderbuffer *rb = NULL;
+ GLenum dstBaseFormat = _mesa_unpack_format_to_base_format(format);
GLenum status, src_base_format;
bool success = false, clear_channels_to_zero = false;
float save_clear_color[4];
@@ -305,7 +306,8 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
type, GL_FALSE))
return false;
- if (_mesa_need_rgb_to_luminance_conversion(rb->Format, format))
+ if (_mesa_need_rgb_to_luminance_conversion(rb->_BaseFormat,
+ dstBaseFormat))
return false;
/* This function rely on BlitFramebuffer to fill in the pixel data for