Bug 46679 - glReadPixels on a luminance texture returns the wrong values
Summary: glReadPixels on a luminance texture returns the wrong values
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Anuj Phogat
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-27 06:35 UTC by Neil Roberts
Modified: 2012-03-09 07:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case for piglit (7.04 KB, patch)
2012-02-27 06:39 UTC, Neil Roberts
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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


bug/show.html.tmpl processed on Jun 27, 2016 at 02:09:16.
(provided by the Example extension).