i965: Use swizzles to force R, G, and B to 0.0 for ALPHA textures.
authorCarl Worth <cworth@cworth.org>
Tue, 22 Jan 2013 21:29:01 +0000 (13:29 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 24 Jan 2013 01:41:09 +0000 (17:41 -0800)
commit8059c2ea9011110df3632e28a4311de9373b9b4e
tree94a8133e65abd94394e402cdeed7d48d7568b5ae
parent33599433c75c0ab433615d08ed7e4002146ba462
i965: Use swizzles to force R, G, and B to 0.0 for ALPHA textures.

Similar to the previous commit, we may be using a texture with actual RGBA
storage for the GL_ALPHA format, so force the color values to 0.0.

This commit fixes the following piglit (sub) tests:

EXT_texture_snorm/fbo-blending-formats
GL_ALPHA16_SNORM
        GL_ALPHA8_SNORM
GL_ALPHA_SNORM

Note: Haswell bypasses this swizzle code, so may require an independent fix
for this bug.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c