aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/i830_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i915/i830_state.c')
-rw-r--r--src/mesa/drivers/dri/i915/i830_state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
index 3136ced5ffb..c6f1b038e32 100644
--- a/src/mesa/drivers/dri/i915/i830_state.c
+++ b/src/mesa/drivers/dri/i915/i830_state.c
@@ -436,7 +436,10 @@ i830DepthMask(struct gl_context * ctx, GLboolean flag)
struct i830_context *i830 = i830_context(ctx);
DBG("%s flag (%d)\n", __FUNCTION__, flag);
-
+
+ if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits)
+ flag = false;
+
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
@@ -795,6 +798,9 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
+ if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits)
+ state = false;
+
if (state)
i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_DEPTH_TEST;
else