On Mon, Apr 18, 2011 at 8:10 PM, Eric Anholt <e...@anholt.net> wrote: > On Mon, 18 Apr 2011 16:16:37 -0700, Ian Romanick <i...@freedesktop.org> wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 04/18/2011 01:37 PM, Eric Anholt wrote: >> > Fixes ARB_texture_float/fbo-alphatest-formats. >> > --- >> > src/mesa/swrast/s_readpix.c | 3 +++ >> > src/mesa/swrast/s_span.c | 3 +++ >> > 2 files changed, 6 insertions(+), 0 deletions(-) >> > >> > diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c >> > index 5604c2e..a201a63 100644 >> > --- a/src/mesa/swrast/s_readpix.c >> > +++ b/src/mesa/swrast/s_readpix.c >> > @@ -195,6 +195,9 @@ fast_read_rgba_pixels( struct gl_context *ctx, >> > rb->_BaseFormat == GL_RGB || >> > rb->_BaseFormat == GL_RG || >> > rb->_BaseFormat == GL_RED || >> > + rb->_BaseFormat == GL_LUMINANCE || >> > + rb->_BaseFormat == GL_INTENSITY || >> > + rb->_BaseFormat == GL_LUMINANCE_ALPHA || >> > rb->_BaseFormat == GL_ALPHA); >> >> At this point would it be easier to just assert the formats that are not >> allowed? Is there even anything that's left as a valid _BaseFormat that >> isn't allowed here? > > I keep wanting to remove asserts like this, and Brian says he likes > them.
I'm sorry you feel inconvenienced, but I'm a big believer in assertions. In these recent cases, perhaps we just need a better, extendable assertion. Something like assert(_mesa_is_base_color_format(rb->_BaseFormat)); -Brian _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev