diff options
author | Patrice Mandin <pmandin@caramail.com> | 2008-02-22 22:21:15 +0100 |
---|---|---|
committer | Patrice Mandin <pmandin@caramail.com> | 2008-02-22 22:21:15 +0100 |
commit | d8a9d850b9d63c7398d596fad2dfd2f05e55ef7d (patch) | |
tree | bf29ae1858aa0bcedddf36622898f5bb4b79631a /src/gallium/drivers | |
parent | 0a5ed0667e6bd934a150bf7f784349fa7f595309 (diff) |
nv30: init zeta to NULL, use color pitch if no zeta
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_state.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c index db4dac24c7..aa3fe7837e 100644 --- a/src/gallium/drivers/nv30/nv30_state.c +++ b/src/gallium/drivers/nv30/nv30_state.c @@ -537,7 +537,7 @@ nv30_set_framebuffer_state(struct pipe_context *pipe, const struct pipe_framebuffer_state *fb) { struct nv30_context *nv30 = nv30_context(pipe); - struct pipe_surface *rt[4], *zeta; + struct pipe_surface *rt[4], *zeta = NULL; uint32_t rt_enable, rt_format, w, h; int i, colour_format = 0, zeta_format = 0; @@ -603,8 +603,15 @@ nv30_set_framebuffer_state(struct pipe_context *pipe, } if (rt_enable & NV34TCL_RT_ENABLE_COLOR0) { + uint32_t pitch = rt[0]->pitch * rt[0]->cpp; + if (zeta) { + pitch |= (zeta->pitch * zeta->cpp)<<16; + } else { + pitch |= pitch<<16; + } + BEGIN_RING(rankine, NV34TCL_COLOR0_PITCH, 1); - OUT_RING ( (rt[0]->pitch * rt[0]->cpp) | ( (zeta->pitch * zeta->cpp) << 16) ); + OUT_RING ( pitch ); nv30->rt[0] = rt[0]->buffer; } |