[Mesa-dev] [PATCH 3/3] Remove gl_config::haveDepthBuffer, haveAccumBuffer, haveStencilBuffer fields

Arnas Milasevicius giant1gf at gmail.com
Sat Jun 8 07:36:14 PDT 2013


Changed code checking `if(visual->haveStencilBuffer)` to `if(visual->stencilBits > 0)`
---
 src/gallium/state_trackers/dri/common/dri_screen.c | 2 +-
 src/mesa/drivers/dri/nouveau/nouveau_context.c     | 4 ++--
 src/mesa/main/clear.c                              | 2 +-
 src/mesa/main/context.c                            | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 4e0f987..e75f447b 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -304,7 +304,7 @@ dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
          stvis->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
    }
 
-   if ((mode->depthBits > 0) || mode->haveStencilBuffer)
+   if ((mode->depthBits > 0) || (mode->stencilBits > 0))
       stvis->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
    /* let the state tracker allocate the accum buffer */
 }
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 45fcada..cebb35a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -266,11 +266,11 @@ nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw)
 		attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
 	if (fb->Visual.doubleBufferMode)
 		attachments[i++] = __DRI_BUFFER_BACK_LEFT;
-	if ((fb->Visual.depthBits > 0) && fb->Visual.haveStencilBuffer)
+	if ((fb->Visual.depthBits > 0) && (fb->Visual.stencilBits > 0))
 		attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL;
 	else if (fb->Visual.depthBits > 0)
 		attachments[i++] = __DRI_BUFFER_DEPTH;
-	else if (fb->Visual.haveStencilBuffer)
+	else if (fb->Visual.stencilBits > 0)
 		attachments[i++] = __DRI_BUFFER_STENCIL;
 
 	buffers = (*screen->dri2.loader->getBuffers)(draw, &draw->w, &draw->h,
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 72ec908..9a69b3f 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -189,7 +189,7 @@ _mesa_Clear( GLbitfield mask )
       }
 
       if ((mask & GL_STENCIL_BUFFER_BIT)
-          && ctx->DrawBuffer->Visual.haveStencilBuffer) {
+          && (ctx->DrawBuffer->Visual.stencilBits > 0)) {
          bufferMask |= BUFFER_BIT_STENCIL;
       }
 
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 35053b9..5f6964a 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1367,7 +1367,7 @@ check_compatible(const struct gl_context *ctx,
       return GL_FALSE;
    if (ctxvis->depthBits > 0 && !(bufvis->depthBits > 0))
       return GL_FALSE;
-   if (ctxvis->haveStencilBuffer && !bufvis->haveStencilBuffer)
+   if ((ctxvis->stencilBits > 0) && !(bufvis->stencilBits > 0))
       return GL_FALSE;
    if (ctxvis->redMask && ctxvis->redMask != bufvis->redMask)
       return GL_FALSE;
-- 
1.8.3



More information about the mesa-dev mailing list