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

Author: Maciej Cencora <m.cenc...@gmail.com>
Date:   Wed Mar 10 22:28:53 2010 +0100

r300: enable depth test only if depth buffer is available

Fixes #23532 and piglit/fbo-nodepth-test piglit/fbo-nostencil-test

---

 src/mesa/drivers/dri/r300/r300_state.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_state.c 
b/src/mesa/drivers/dri/r300/r300_state.c
index 8748941..e75c88e 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -590,7 +590,7 @@ static void r300SetDepthState(GLcontext * ctx)
                                            R500_STENCIL_REFMASK_FRONT_BACK);
        r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_Z_FUNC_SHIFT);
 
-       if (ctx->Depth.Test) {
+       if (ctx->Depth.Test && ctx->DrawBuffer->_DepthBuffer) {
                r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_Z_ENABLE;
                if (ctx->Depth.Mask)
                        r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_Z_WRITE_ENABLE;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to