OSDN Git Service

st/mesa: need to translate clear color according to surface's base format
authorBrian Paul <brianp@vmware.com>
Mon, 21 Feb 2011 23:54:23 +0000 (16:54 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 21 Feb 2011 23:58:42 +0000 (16:58 -0700)
commite2d108ec828bdbebdc7e8f9df30c86f0b521aa8d
tree4fb4356845c47e48a681ecbfaab58a412ccfd683
parentc966c6980c2a4a1e50b238f7607a9ce111f6c0b4
st/mesa: need to translate clear color according to surface's base format

When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert
the clear color (R,G,B,A) to (R,R,R,A).  We were doing this for texture border
colors but not renderbuffers.  Move the translation function to st_format.c
and share it.

This fixes the piglit fbo-clear-formats test.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_cb_clear.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_format.h