}
else if (is_depth_format(internalFormat)) {
/* make sure we have depth/stencil buffers */
- if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer) {
+ if (!ctx->ReadBuffer->_DepthBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%D(no depth)", dimensions);
return GL_TRUE;
}
else if (is_depthstencil_format(internalFormat)) {
/* make sure we have depth/stencil buffers */
- if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer ||
- !ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer) {
+ if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%D(no depth/stencil buffer)", dimensions);
return GL_TRUE;
}
if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) {
- if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer) {
+ if (!ctx->ReadBuffer->_DepthBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexSubImage%D(no depth buffer)",
dimensions);
}
}
else if (teximage->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
- if (!ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer ||
- !ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer) {
+ if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexSubImage%D(no depth/stencil buffer)",
dimensions);
clear_color_buffers(ctx);
}
if (mask & BUFFER_BIT_DEPTH) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- _swrast_clear_depth_buffer(ctx, rb);
+ _swrast_clear_depth_buffer(ctx, ctx->DrawBuffer->_DepthBuffer);
}
if (mask & BUFFER_BIT_ACCUM) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
- _swrast_clear_accum_buffer(ctx, rb);
+ _swrast_clear_accum_buffer(ctx,
+ ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
}
if (mask & BUFFER_BIT_STENCIL) {
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
- _swrast_clear_stencil_buffer(ctx, rb);
+ _swrast_clear_stencil_buffer(ctx, ctx->DrawBuffer->_StencilBuffer);
}
}
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *readRb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *readRb = fb->_DepthBuffer;
const GLfloat depthMax = fb->_DepthMaxF;
GLfloat *p, *tmpImage;
GLint sy, dy, stepy;
GLint destx, GLint desty )
{
struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
GLint sy, dy, stepy;
GLint j;
GLstencil *p, *tmpImage;
= ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0;
GLint overlapping;
- depthDrawRb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- depthReadRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- stencilReadRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ depthDrawRb = ctx->DrawBuffer->_DepthBuffer;
+ depthReadRb = ctx->ReadBuffer->_DepthBuffer;
+ stencilReadRb = ctx->ReadBuffer->_StencilBuffer;
ASSERT(depthDrawRb);
ASSERT(depthReadRb);
depth_test_span( GLcontext *ctx, struct sw_span *span)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
const GLint x = span->x;
const GLint y = span->y;
const GLuint count = span->end;
depth_test_pixels( GLcontext *ctx, struct sw_span *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
const GLuint count = span->end;
const GLint *x = span->array->x;
const GLint *y = span->array->y;
_swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
GLuint zMin = (GLuint) (ctx->Depth.BoundsMin * fb->_DepthMaxF + 0.5F);
GLuint zMax = (GLuint) (ctx->Depth.BoundsMax * fb->_DepthMaxF + 0.5F);
GLubyte *mask = span->array->mask;
struct gl_pixelstore_attrib clippedUnpack = *unpack;
GLint i;
- depthRb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- stencilRb = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ depthRb = ctx->DrawBuffer->_DepthBuffer;
+ stencilRb = ctx->DrawBuffer->_StencilBuffer;
ASSERT(depthRb);
ASSERT(stencilRb);
const struct gl_pixelstore_attrib *packing )
{
struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_DepthBuffer;
GLboolean bias_or_scale;
/* clipping should have been done already */
const struct gl_pixelstore_attrib *packing )
{
struct gl_framebuffer *fb = ctx->ReadBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
GLint j;
ASSERT(rb);
struct gl_renderbuffer *depthRb, *stencilRb;
GLint i;
- depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ depthRb = ctx->ReadBuffer->_DepthBuffer;
+ stencilRb = ctx->ReadBuffer->_StencilBuffer;
ASSERT(depthRb);
ASSERT(stencilRb);
stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
GLstencil stencilRow[MAX_WIDTH];
GLstencil *stencil;
const GLuint n = span->end;
GLenum oper, GLuint face, const GLubyte mask[] )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
const GLstencil stencilMax = (1 << fb->Visual.stencilBits) - 1;
const GLstencil ref = ctx->Stencil.Ref[face];
const GLstencil wrtmask = ctx->Stencil.WriteMask[face];
const GLint x[], const GLint y[], GLubyte mask[] )
{
const struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
GLubyte fail[MAX_WIDTH];
GLstencil r, s;
GLuint i;
stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
const GLuint n = span->end;
const GLint *x = span->array->x;
const GLint *y = span->array->y;
const GLstencil stencil[] )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
- struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *rb = fb->_StencilBuffer;
const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
const GLuint stencilMask = ctx->Stencil.WriteMask[0];
read_depth_image( GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height )
{
- struct gl_renderbuffer *rb
- = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLfloat *image, *dst;
GLint i;
read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y,
GLsizei width, GLsizei height)
{
- struct gl_renderbuffer *depthRb
- = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
- struct gl_renderbuffer *stencilRb
- = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
+ struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer;
+ struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer;
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint *image, *dst;
GLint i;
#define NAME occlusion_zless_triangle
#define INTERP_Z 1
#define SETUP_CODE \
- struct gl_renderbuffer *rb \
- = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; \
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer; \
struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; \
ASSERT(ctx->Depth.Test); \
ASSERT(!ctx->Depth.Mask); \
GLint width, GLint spanX, GLint spanY,
const GLvoid *z)
{
- struct gl_renderbuffer *rb
- = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
+ struct gl_renderbuffer *rb = ctx->DrawBuffer->_DepthBuffer;
GLushort zoomedVals16[MAX_WIDTH];
GLuint zoomedVals32[MAX_WIDTH];
GLint x0, x1, y0, y1, y;