[Mesa-dev] [PATCH 02/14] swrast: Don't assert against glReadPixels of GL_RED and GL_RG.

Eric Anholt eric at anholt.net
Sun Apr 17 11:59:57 PDT 2011


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.
---
 src/mesa/swrast/s_readpix.c |    5 ++++-
 src/mesa/swrast/s_span.c    |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 5c8d7e9..cca7ec0 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -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 */
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 9cfecc9..b0f8e49 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -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) {
-- 
1.7.4.1



More information about the mesa-dev mailing list