nouveau: 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/nouveau/nouveau_span.c
src/mesa/drivers/dri/nouveau/nv04_state_fb.c
src/mesa/drivers/dri/nouveau/nv10_context.c
src/mesa/drivers/dri/nouveau/nv10_state_fb.c
src/mesa/drivers/dri/nouveau/nv20_context.c
src/mesa/drivers/dri/nouveau/nv20_state_fb.c

index 761cc769efed61fe94130b26657238ca2255e4a7..c02682b2dd3acfb09b95671929ec282ff172f6c4 100644 (file)
@@ -152,8 +152,8 @@ framebuffer_map_unmap(struct gl_framebuffer *fb, GLboolean map)
 
        renderbuffer_map_unmap(fb->_ColorReadBuffer, map);
 
-       if (fb->_DepthBuffer)
-               renderbuffer_map_unmap(fb->_DepthBuffer->Wrapped, map);
+       if (fb->Attachment[BUFFER_DEPTH].Renderbuffer)
+               renderbuffer_map_unmap(fb->Attachment[BUFFER_DEPTH].Renderbuffer, map);
 }
 
 static void
index 854571d07e033211c96cf931d0202fbad0c12ab7..cc591a32ed18199d2c03b096f866f82eb5fc3ac9 100644 (file)
@@ -76,9 +76,9 @@ nv04_emit_framebuffer(struct gl_context *ctx, int emit)
        }
 
        /* depth/stencil */
-       if (fb->_DepthBuffer) {
+       if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
                s = &to_nouveau_renderbuffer(
-                       fb->_DepthBuffer->Wrapped)->surface;
+                       fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
                zeta_pitch = s->pitch;
 
index c4dc1c5767a7ee2639fa9e0c20bd48d9dcbcdcfe..0b0d549bf1fdfb3e2a0c3bc22301c787fea181d3 100644 (file)
@@ -61,10 +61,11 @@ nv10_use_viewport_zclear(struct gl_context *ctx)
 {
        struct nouveau_context *nctx = to_nouveau_context(ctx);
        struct gl_framebuffer *fb = ctx->DrawBuffer;
+       struct gl_renderbuffer *depthRb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
 
        return context_chipset(ctx) < 0x17 &&
-               !nctx->hierz.clear_blocked && fb->_DepthBuffer &&
-               (_mesa_get_format_bits(fb->_DepthBuffer->Format,
+               !nctx->hierz.clear_blocked && depthRb &&
+               (_mesa_get_format_bits(depthRb->Format,
                                       GL_DEPTH_BITS) >= 24);
 }
 
@@ -97,7 +98,7 @@ nv10_zclear(struct gl_context *ctx, GLbitfield *buffers)
        struct gl_framebuffer *fb = ctx->DrawBuffer;
        struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(fb);
        struct nouveau_surface *s = &to_nouveau_renderbuffer(
-               fb->_DepthBuffer->Wrapped)->surface;
+               fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
        if (nv10_use_viewport_zclear(ctx)) {
                int x, y, w, h;
@@ -148,7 +149,7 @@ nv17_zclear(struct gl_context *ctx, GLbitfield *buffers)
        struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(
                ctx->DrawBuffer);
        struct nouveau_surface *s = &to_nouveau_renderbuffer(
-               nfb->base._DepthBuffer->Wrapped)->surface;
+               nfb->base.Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
        /* Clear the hierarchical depth buffer */
        BEGIN_RING(chan, celsius, NV17_3D_HIERZ_FILL_VALUE, 1);
index 05055474218a46be6c7d3f450a02e8fb8baba8d5..a590bcd30e1ca8a276102d030d6d6f84ec755258 100644 (file)
@@ -125,9 +125,9 @@ nv10_emit_framebuffer(struct gl_context *ctx, int emit)
        }
 
        /* depth/stencil */
-       if (fb->_DepthBuffer) {
+       if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
                s = &to_nouveau_renderbuffer(
-                       fb->_DepthBuffer->Wrapped)->surface;
+                       fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
                rt_format |= get_rt_format(s->format);
                zeta_pitch = s->pitch;
index 2a883e31088c960f3b49169f1e85c3614abd668d..83091fe8a7b672b566c6eb531547b01602e89969 100644 (file)
@@ -66,7 +66,7 @@ nv20_clear(struct gl_context *ctx, GLbitfield buffers)
 
        if (buffers & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) {
                struct nouveau_surface *s = &to_nouveau_renderbuffer(
-                       fb->_DepthBuffer->Wrapped)->surface;
+                       fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
                if (buffers & BUFFER_BIT_DEPTH && ctx->Depth.Mask)
                        clear |= NV20_3D_CLEAR_BUFFERS_DEPTH;
index cbde74e4fc68ded1a086116341f9473a737c3ed1..28f72dcf4373a85c4be2113364e791b1762b2e0a 100644 (file)
@@ -104,9 +104,9 @@ nv20_emit_framebuffer(struct gl_context *ctx, int emit)
        }
 
        /* depth/stencil */
-       if (fb->_DepthBuffer) {
+       if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
                s = &to_nouveau_renderbuffer(
-                       fb->_DepthBuffer->Wrapped)->surface;
+                       fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
 
                rt_format |= get_rt_format(s->format);
                zeta_pitch = s->pitch;