[Mesa-dev] [PATCH 3/6] mesa: check attachment Type field in renderbuffer_exists()

Brian Paul brian.e.paul at gmail.com
Mon Oct 10 20:05:33 PDT 2011


From: Brian Paul <brianp at vmware.com>

Instead of the renderbuffer pointer.  In the future, attaching a texture
may not mean the renderbuffer pointer gets set too.
Plus, remove some commented-out assertions.
---
 src/mesa/main/framebuffer.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 90ac2ef..efaf9f5 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -896,27 +896,21 @@ renderbuffer_exists(struct gl_context *ctx,
       break;
    case GL_DEPTH:
    case GL_DEPTH_COMPONENT:
-      if (!att[BUFFER_DEPTH].Renderbuffer) {
+      if (att[BUFFER_DEPTH].Type == GL_NONE) {
          return GL_FALSE;
       }
-      /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/
       break;
    case GL_STENCIL:
    case GL_STENCIL_INDEX:
-      if (!att[BUFFER_STENCIL].Renderbuffer) {
+      if (att[BUFFER_STENCIL].Type == GL_NONE) {
          return GL_FALSE;
       }
-      /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/
       break;
    case GL_DEPTH_STENCIL_EXT:
-      if (!att[BUFFER_DEPTH].Renderbuffer ||
-          !att[BUFFER_STENCIL].Renderbuffer) {
+      if (att[BUFFER_DEPTH].Type == GL_NONE ||
+          att[BUFFER_STENCIL].Type == GL_NONE) {
          return GL_FALSE;
       }
-      /*
-      ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);
-      ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);
-      */
       break;
    default:
       _mesa_problem(ctx,
-- 
1.7.3.4



More information about the mesa-dev mailing list