Bug 46679

Summary: glReadPixels on a luminance texture returns the wrong values
Product: Mesa Reporter: Neil Roberts <nroberts>
Component: Mesa coreAssignee: Anuj Phogat <anuj.phogat>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Test case for piglit

Description Neil Roberts 2012-02-27 06:35:33 UTC
According to the GL spec, it seems when reading values from a texture in luminance format it should set the R component to the luminance value and set the G and B components to zero but Mesa is currently setting all of the components to the luminance value. This makes it so that if you try to read it back in luminance format you don't get the same values you put in. There is already code in texgetimage.c to handle this for glGetTexImage so I guess we should just copy that to somewhere in readpix.c.

This bug was found while discussing bug 46631.
Comment 1 Neil Roberts 2012-02-27 06:39:00 UTC
Created attachment 57719 [details] [review]
Test case for piglit
Comment 2 Brian Paul 2012-03-08 13:43:14 UTC
Anuj, I've got some Mesa patches to fix this.  I just need to clean them up and post for review...
Comment 3 Brian Paul 2012-03-09 07:46:22 UTC
Fixed with commit f5d0ced242abc9e4e777bbe374585f44399b75af

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.