summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx
diff options
context:
space:
mode:
authorXavier Chantry <[email protected]>2010-11-24 21:50:36 +0100
committerFrancisco Jerez <[email protected]>2010-11-25 17:04:29 +0100
commitc14a261eb96b52052233e7590aa2c28f6f21b8ea (patch)
tree7085ff44eec98915049d08af464f7f01483f84d3 /src/gallium/drivers/nvfx
parent049065cdfaf3f890381133c4a98743b22907797d (diff)
nvfx: reset nvfx->hw_zeta
If nvfx_framebuffer prepare and validate were called successively with fb->zsbuf not NULL and then NULL, nvfx->hw_zeta would contain garbage and this would cause failures in nvfx_framebuffer_relocate/OUT_RELOC(hw_zeta). This was triggered by piglit/texwrap 2D GL_DEPTH_COMPONENT24 and caused first a 'write to user buffer!!' error in libdrm and then worse things. Signed-off-by: Xavier Chantry <[email protected]> Signed-off-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_fb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_state_fb.c b/src/gallium/drivers/nvfx/nvfx_state_fb.c
index 73885de4514..90eb11085ef 100644
--- a/src/gallium/drivers/nvfx/nvfx_state_fb.c
+++ b/src/gallium/drivers/nvfx/nvfx_state_fb.c
@@ -113,7 +113,9 @@ nvfx_framebuffer_validate(struct nvfx_context *nvfx, unsigned prepare_result)
nvfx->state.render_temps |= nvfx_surface_get_render_target(fb->cbufs[i], prepare_result, &nvfx->hw_rt[i]) << i;
for(; i < 4; ++i)
- nvfx->hw_rt[i].bo = 0;
+ nvfx->hw_rt[i].bo = NULL;
+
+ nvfx->hw_zeta.bo = NULL;
if (fb->zsbuf) {
nvfx->state.render_temps |= nvfx_surface_get_render_target(fb->zsbuf, prepare_result, &nvfx->hw_zeta) << 7;