We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on. Fixes
fbo-nodepth-test.
Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset. However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
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;
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
/*
* 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));