break;
}
- stvis->accum_format = (mode->haveAccumBuffer) ?
+ stvis->accum_format = (mode->accumRedBits > 0) ?
PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
stvis->buffer_mask |= ST_ATTACHMENT_FRONT_LEFT_MASK;
stvis->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
}
- if (mode->haveDepthBuffer || 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 */
}
vis->accumBlueBits = accum_blue_size;
vis->accumAlphaBits = accum_alpha_size;
- vis->haveAccumBuffer = accum_red_size > 0;
- vis->haveDepthBuffer = depth_size > 0;
- vis->haveStencilBuffer = stencil_size > 0;
-
vis->numAuxBuffers = 0;
vis->level = 0;
vis->sampleBuffers = num_samples > 1;
modes->samples = msaa_samples[h];
modes->sampleBuffers = modes->samples ? 1 : 0;
-
- modes->haveAccumBuffer = ((modes->accumRedBits +
- modes->accumGreenBits +
- modes->accumBlueBits +
- modes->accumAlphaBits) > 0);
- modes->haveDepthBuffer = (modes->depthBits > 0);
- modes->haveStencilBuffer = (modes->stencilBits > 0);
-
modes->bindToTextureRgb = GL_TRUE;
modes->bindToTextureRgba = GL_TRUE;
modes->bindToMipmapTexture = GL_FALSE;
attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
if (fb->Visual.doubleBufferMode)
attachments[i++] = __DRI_BUFFER_BACK_LEFT;
- if (fb->Visual.haveDepthBuffer && fb->Visual.haveStencilBuffer)
+ if (fb->Visual.depthBits > 0 && fb->Visual.stencilBits > 0)
attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL;
- else if (fb->Visual.haveDepthBuffer)
+ 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,
/* add software renderbuffers */
_swrast_add_soft_renderbuffers(fb,
GL_FALSE, /* color */
- visual->haveDepthBuffer,
- visual->haveStencilBuffer,
- visual->haveAccumBuffer,
+ visual->depthBits > 0,
+ visual->stencilBits > 0,
+ visual->accumRedBits > 0,
GL_FALSE, /* alpha */
GL_FALSE /* aux bufs */);
*/
_swrast_add_soft_renderbuffers(osmesa->gl_buffer,
GL_FALSE, /* color */
- osmesa->gl_visual->haveDepthBuffer,
- osmesa->gl_visual->haveStencilBuffer,
- osmesa->gl_visual->haveAccumBuffer,
+ osmesa->gl_visual->depthBits > 0,
+ osmesa->gl_visual->stencilBits > 0,
+ osmesa->gl_visual->accumRedBits > 0,
GL_FALSE, /* alpha */
GL_FALSE /* aux */ );
*/
_swrast_add_soft_renderbuffers(&b->mesa_buffer,
GL_FALSE, /* color */
- vis->mesa_visual.haveDepthBuffer,
- vis->mesa_visual.haveStencilBuffer,
- vis->mesa_visual.haveAccumBuffer,
+ vis->mesa_visual.depthBits > 0,
+ vis->mesa_visual.stencilBits > 0,
+ vis->mesa_visual.accumRedBits > 0,
GL_FALSE, /* software alpha buffer */
vis->mesa_visual.numAuxBuffers > 0 );
return;
}
- if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) {
+ if (ctx->DrawBuffer->Visual.accumRedBits == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)");
return;
}
}
if ((mask & GL_DEPTH_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveDepthBuffer) {
+ && ctx->DrawBuffer->Visual.depthBits > 0) {
bufferMask |= BUFFER_BIT_DEPTH;
}
if ((mask & GL_STENCIL_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveStencilBuffer) {
+ && ctx->DrawBuffer->Visual.stencilBits > 0) {
bufferMask |= BUFFER_BIT_STENCIL;
}
if ((mask & GL_ACCUM_BUFFER_BIT)
- && ctx->DrawBuffer->Visual.haveAccumBuffer) {
+ && ctx->DrawBuffer->Visual.accumRedBits > 0) {
bufferMask |= BUFFER_BIT_ACCUM;
}
vis->accumBlueBits = accumBlueBits;
vis->accumAlphaBits = accumAlphaBits;
- vis->haveAccumBuffer = accumRedBits > 0;
- vis->haveDepthBuffer = depthBits > 0;
- vis->haveStencilBuffer = stencilBits > 0;
-
vis->numAuxBuffers = 0;
vis->level = 0;
vis->sampleBuffers = numSamples > 0 ? 1 : 0;
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_DEPTH].Renderbuffer;
const mesa_format fmt = rb->Format;
- fb->Visual.haveDepthBuffer = GL_TRUE;
fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS);
}
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_STENCIL].Renderbuffer;
const mesa_format fmt = rb->Format;
- fb->Visual.haveStencilBuffer = GL_TRUE;
fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS);
}
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_ACCUM].Renderbuffer;
const mesa_format fmt = rb->Format;
- fb->Visual.haveAccumBuffer = GL_TRUE;
fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
fb->Visual.accumBlueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS);
GLuint doubleBufferMode;
GLuint stereoMode;
- GLboolean haveAccumBuffer;
- GLboolean haveDepthBuffer;
- GLboolean haveStencilBuffer;
-
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
GLuint redMask, greenMask, blueMask, alphaMask;
GLint redShift, greenShift, blueShift, alphaShift;
mode->stencilBits =
util_format_get_component_bits(visual->depth_stencil_format,
UTIL_FORMAT_COLORSPACE_ZS, 1);
-
- mode->haveDepthBuffer = mode->depthBits > 0;
- mode->haveStencilBuffer = mode->stencilBits > 0;
}
if (visual->accum_format != PIPE_FORMAT_NONE) {
- mode->haveAccumBuffer = GL_TRUE;
-
mode->accumRedBits =
util_format_get_component_bits(visual->accum_format,
UTIL_FORMAT_COLORSPACE_RGB, 0);