[Mesa-dev] [PATCH 03/13] nouveau: stop using _DepthBuffer, _StencilBuffer fields
Brian Paul
brianp at vmware.com
Sat Dec 10 10:58:29 PST 2011
---
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 761cc76..c02682b 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 854571d..cc591a3 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 c4dc1c5..0b0d549 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 0505547..a590bcd 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 2a883e3..83091fe 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 cbde74e..28f72dc 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;
--
1.7.3.4
More information about the mesa-dev
mailing list