radeon: stop using _DepthBuffer, _StencilBuffer fields
authorBrian Paul <brianp@vmware.com>
Sat, 10 Dec 2011 18:44:43 +0000 (11:44 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 13 Dec 2011 13:45:36 +0000 (06:45 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/radeon/radeon_common.c
src/mesa/drivers/dri/radeon/radeon_tex_copy.c

index 894a01f91f5ee098d96e8bf9f36186a2a4050d83..bb9cb2aa6a2a204adcb291917664e0ecd6c26ffb 100644 (file)
@@ -313,8 +313,8 @@ void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
                radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE);
 
 
-       if (fb->_DepthBuffer && fb->_DepthBuffer->Wrapped) {
-               rrbDepth = radeon_renderbuffer(fb->_DepthBuffer->Wrapped);
+       if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
+               rrbDepth = radeon_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
                if (rrbDepth && rrbDepth->bo) {
                        radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DEPTH_BUFFER, GL_FALSE);
                } else {
@@ -325,8 +325,8 @@ void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
                rrbDepth = NULL;
        }
 
-       if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) {
-               rrbStencil = radeon_renderbuffer(fb->_StencilBuffer->Wrapped);
+       if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
+               rrbStencil = radeon_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
                if (rrbStencil && rrbStencil->bo) {
                        radeon->vtbl.fallback(ctx, RADEON_FALLBACK_STENCIL_BUFFER, GL_FALSE);
                        /* need to re-compute stencil hw state */
index ca0ac16170944a99399f662296214a62a36d2971..76ca8e6b27dc1e82022c7fe1d36af436fd1028d5 100644 (file)
@@ -58,13 +58,12 @@ do_copy_texsubimage(struct gl_context *ctx,
     }
 
     if (_mesa_get_format_bits(timg->base.Base.TexFormat, GL_DEPTH_BITS) > 0) {
-        if (ctx->ReadBuffer->_DepthBuffer && ctx->ReadBuffer->_DepthBuffer->Wrapped) {
-            rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer->Wrapped);
-        } else {
-            rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer);
-        }
+        /* copying a depth values */
+        rrb = radeon_renderbuffer(ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer);
+        assert(rrb);
         flip_y = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Type == GL_NONE;
     } else {
+        /* copying color */
         rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
         flip_y = ctx->ReadBuffer->Attachment[BUFFER_COLOR0].Type == GL_NONE;
     }