swrast: Don't assert against glReadPixels of GL_RED and GL_RG.
authorEric Anholt <eric@anholt.net>
Sat, 16 Apr 2011 00:50:41 +0000 (17:50 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Apr 2011 18:19:53 +0000 (11:19 -0700)
Everything appears to already be in place for this.  Fixes aborts in:
ARB_texture_rg/fbo-alphatest-formats-float
ARB_texture_rg/fbo-blending-formats-float.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_readpix.c
src/mesa/swrast/s_span.c

index 5c8d7e9c5cf66f9581d53fa6c556dc638fabbf42..cca7ec008024987fbe516247acfad734799e3608 100644 (file)
@@ -191,7 +191,10 @@ fast_read_rgba_pixels( struct gl_context *ctx,
    if (!rb)
       return GL_FALSE;
 
-   ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB ||
+   ASSERT(rb->_BaseFormat == GL_RGBA ||
+         rb->_BaseFormat == GL_RGB ||
+         rb->_BaseFormat == GL_RG ||
+         rb->_BaseFormat == GL_RED ||
          rb->_BaseFormat == GL_ALPHA);
 
    /* clipping should have already been done */
index 9cfecc9e3a416a1c89153c711b9c415102c58726..b0f8e4904327f657340410e3b609ee0e3713a17f 100644 (file)
@@ -1348,7 +1348,10 @@ _swrast_read_rgba_span( struct gl_context *ctx, struct gl_renderbuffer *rb,
 
       ASSERT(rb);
       ASSERT(rb->GetRow);
-      ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA ||
+      ASSERT(rb->_BaseFormat == GL_RGBA ||
+            rb->_BaseFormat == GL_RGB ||
+            rb->_BaseFormat == GL_RG ||
+            rb->_BaseFormat == GL_RED ||
             rb->_BaseFormat == GL_ALPHA);
 
       if (rb->DataType == dstType) {