ReadPixels: Force ALPHA to 1 while rebasing RGBA values for GL_RGB format
authorCarl Worth <cworth@cworth.org>
Mon, 21 Jan 2013 20:16:27 +0000 (12:16 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 24 Jan 2013 01:40:52 +0000 (17:40 -0800)
commit570ed2be7d776211e1ca2a7a4c44ee6a1d141714
tree73bc8e5588c6b1d3547ebd48305213fa8fa90e8e
parentb961ba44ed01d4aa590609fc91ab1250ac7d9559
ReadPixels: Force ALPHA to 1 while rebasing RGBA values for GL_RGB format

When performing a ReadPixels operation, we may be reading from a buffer that
stores alpha values, but that is actually representing a buffer with no alpha
channel. In this case, while rebasing the values, touch up all alpha values
read to 1.0.

This commit fixes the following piglit (sub) tests:

ARB_texture_float/fbo-colormask-formats
GL_RBG16F_ARB
EXT_texture_snorm/fbo-colormask-formats
GL_RGB16_SNORM
GL_RGB8_SNORM
GL_RGB_SNORM

It likely improves the results of other tests as well, but a PASS remains
elusive due to additional bugs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/pack.c