[Mesa-dev] [PATCH 02/13] mesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT()

Brian Paul brianp at vmware.com
Sat Dec 10 10:58:28 PST 2011


We're just looking at the depth/stencil renderbuffers to do error
checking.  We don't need to look at the depth/stencil wrappers to do
that.  Also, remove pointless readRb = depthRb = NULL assignments.
---
 src/mesa/main/fbobject.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 9111caa..611a6d0 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2669,8 +2669,10 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
    }
 
    if (mask & GL_STENCIL_BUFFER_BIT) {
-      struct gl_renderbuffer *readRb = readFb->_StencilBuffer;
-      struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer;
+      struct gl_renderbuffer *readRb =
+         readFb->Attachment[BUFFER_STENCIL].Renderbuffer;
+      struct gl_renderbuffer *drawRb =
+         drawFb->Attachment[BUFFER_STENCIL].Renderbuffer;
 
       /* From the EXT_framebuffer_object spec:
        *
@@ -2679,7 +2681,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
        *     ignored."
        */
       if ((readRb == NULL) || (drawRb == NULL)) {
-	 readRb = drawRb = NULL;
 	 mask &= ~GL_STENCIL_BUFFER_BIT;
       }
       else if (_mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) !=
@@ -2691,8 +2692,10 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
    }
 
    if (mask & GL_DEPTH_BUFFER_BIT) {
-      struct gl_renderbuffer *readRb = readFb->_DepthBuffer;
-      struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer;
+      struct gl_renderbuffer *readRb =
+         readFb->Attachment[BUFFER_DEPTH].Renderbuffer;
+      struct gl_renderbuffer *drawRb =
+         drawFb->Attachment[BUFFER_DEPTH].Renderbuffer;
 
       /* From the EXT_framebuffer_object spec:
        *
@@ -2701,7 +2704,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
        *     ignored."
        */
       if ((readRb == NULL) || (drawRb == NULL)) {
-	 readRb = drawRb = NULL;
 	 mask &= ~GL_DEPTH_BUFFER_BIT;
       }
       else if (_mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) !=
-- 
1.7.3.4



More information about the mesa-dev mailing list