diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_state.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_vtbl.c | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 99212ad4fd1..73dda65261e 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -375,6 +375,9 @@ i915DepthMask(struct gl_context * ctx, GLboolean flag) DBG("%s flag (%d)\n", __FUNCTION__, flag); + if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits) + flag = false; + dw = i915->state.Ctx[I915_CTXREG_LIS6]; if (flag && ctx->Depth.Test) dw |= S6_DEPTH_WRITE_ENABLE; @@ -797,6 +800,10 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state) case GL_DEPTH_TEST: dw = i915->state.Ctx[I915_CTXREG_LIS6]; + + if (!ctx->DrawBuffer || !ctx->DrawBuffer->Visual.depthBits) + state = false; + if (state) dw |= S6_DEPTH_TEST_ENABLE; else diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 49ffd787695..95c56bc8893 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -798,8 +798,7 @@ i915_update_draw_buffer(struct intel_context *intel) /* * Update depth and stencil test state */ - ctx->Driver.Enable(ctx, GL_DEPTH_TEST, - (ctx->Depth.Test && fb->Visual.depthBits > 0)); + ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); ctx->Driver.Enable(ctx, GL_STENCIL_TEST, (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0)); |