[Mesa-dev] [PATCH 2/3] Remove gl_config::haveDepthBuffer, haveAccumBuffer, haveStencilBuffer fields
Arnas Milasevicius
giant1gf at gmail.com
Sat Jun 8 07:36:03 PDT 2013
Changed code checking `if(visual->haveAccumBuffer)` to `if(visual->accumRedBits + visual->accumGreenBits + visual->accumBlueBits + visual->accumAlphaBits) > 0)`
---
src/mesa/main/accum.c | 2 +-
src/mesa/main/clear.c | 2 +-
src/mesa/main/context.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 421fe6c..8801dbd 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -72,7 +72,7 @@ _mesa_Accum( GLenum op, GLfloat value )
return;
}
- if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) {
+ if ((ctx->DrawBuffer->Visual.accumRedBits + ctx->DrawBuffer->Visual.accumGreenBits + ctx->DrawBuffer->Visual.accumBlueBits + ctx->DrawBuffer->Visual.accumAlphaBits) == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)");
return;
}
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index a6a9b84..72ec908 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -194,7 +194,7 @@ _mesa_Clear( GLbitfield mask )
}
if ((mask & GL_ACCUM_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveAccumBuffer) {
+ && ((ctx->DrawBuffer->Visual.accumRedBits + ctx->DrawBuffer->Visual.accumGreenBits + ctx->DrawBuffer->Visual.accumBlueBits + ctx->DrawBuffer->Visual.accumAlphaBits) > 0)) {
bufferMask |= BUFFER_BIT_ACCUM;
}
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 26f2878..35053b9 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1363,7 +1363,7 @@ check_compatible(const struct gl_context *ctx,
#endif
if (ctxvis->stereoMode && !bufvis->stereoMode)
return GL_FALSE;
- if (ctxvis->haveAccumBuffer && !bufvis->haveAccumBuffer)
+ if (((ctxvis->accumRedBits + ctxvis->accumGreenBits + ctxvis->accumBlueBits + ctxvis->accumAlphaBits) > 0) && !(bufvis->accumRedBits + bufvis->accumGreenBits + bufvis->accumBlueBits + bufvis->accumAlphaBits) > 0)
return GL_FALSE;
if (ctxvis->depthBits > 0 && !(bufvis->depthBits > 0))
return GL_FALSE;
--
1.8.3
More information about the mesa-dev
mailing list