Mesa (master): softpipe: make z/s test always pass if no zsbuf, instead of crashing

Luca Barbieri lb at kemper.freedesktop.org
Mon Sep 20 18:33:24 UTC 2010


Module: Mesa
Branch: master
Commit: 2e7d1c2c86014d8bdd615d587fb9e98bc8eda605
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e7d1c2c86014d8bdd615d587fb9e98bc8eda605

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Mon Sep 20 19:22:44 2010 +0200

softpipe: make z/s test always pass if no zsbuf, instead of crashing

D3D10 specifies this.

---

 src/gallium/drivers/softpipe/sp_quad_depth_test.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index 5590d40..425fecd 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -695,8 +695,9 @@ depth_test_quads_fallback(struct quad_stage *qs,
       nr = alpha_test_quads(qs, quads, nr);
    }
 
-   if (qs->softpipe->depth_stencil->depth.enabled ||
-       qs->softpipe->depth_stencil->stencil[0].enabled) {
+   if (qs->softpipe->framebuffer.zsbuf &&
+	(qs->softpipe->depth_stencil->depth.enabled ||
+       qs->softpipe->depth_stencil->stencil[0].enabled)) {
 
       data.ps = qs->softpipe->framebuffer.zsbuf;
       data.format = data.ps->format;
@@ -805,6 +806,9 @@ choose_depth_test(struct quad_stage *qs,
 
    boolean occlusion = qs->softpipe->active_query_count;
 
+   if(!qs->softpipe->framebuffer.zsbuf)
+      depth = depthwrite = stencil = FALSE;
+
    /* default */
    qs->run = depth_test_quads_fallback;
 




More information about the mesa-commit mailing list