From d1240928641f5073865cc2f3ef87bd3b0cd64b04 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Dec 2011 11:44:43 -0700 Subject: [PATCH] mesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT() 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. Reviewed-by: Eric Anholt --- src/mesa/main/fbobject.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 9111caa1b56..611a6d0b042 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) != -- 2.30.2