From a782db5570a45008f153396070eae153305a7953 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Dec 2011 11:44:43 -0700 Subject: [PATCH] nouveau: stop using _DepthBuffer, _StencilBuffer fields Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/nouveau/nouveau_span.c | 4 ++-- src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 4 ++-- src/mesa/drivers/dri/nouveau/nv10_context.c | 9 +++++---- src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 4 ++-- src/mesa/drivers/dri/nouveau/nv20_context.c | 2 +- src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c index 761cc769efe..c02682b2dd3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_span.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c @@ -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 diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c index 854571d07e0..cc591a32ed1 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c @@ -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; diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index c4dc1c5767a..0b0d549bf1f 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -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); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index 05055474218..a590bcd30e1 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -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; diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index 2a883e31088..83091fe8a7b 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -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; diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c index cbde74e4fc6..28f72dcf437 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c @@ -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; -- 2.30.2