summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-03-02 13:09:51 -0800
committerEric Anholt <[email protected]>2012-03-02 17:16:11 -0800
commit4d4f2daefabdc4ca1dd778a9265475c65ef52936 (patch)
treec1bfa1eedee239deed39d2dc57d2a9c3edae5e0b /src
parenta9073e34863977f24ade27c0f332fe044495a09b (diff)
i915: Fix piglit fbo-nodepth-test on i830.
This is a direct port of fc4fba52cf7e9616c70dd76b4d6bdba6582e157b from i915, and fixes GPU hangs when running piglit. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372 Reviewed-by: Eric Anholt <[email protected]> NOTE: This is a candidate for release branches.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/i830_state.c8
-rw-r--r--src/mesa/drivers/dri/i915/i830_vtbl.c3
2 files changed, 8 insertions, 3 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
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 8b255966904..8acbc871861 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -826,8 +826,7 @@ i830_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));