summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/stencil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/stencil.c')
-rw-r--r--src/mesa/main/stencil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index e4a255d0a7e..15c98e20156 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -536,7 +536,11 @@ _mesa_update_stencil(GLcontext *ctx)
{
const GLint face = ctx->Stencil._BackFace;
- ctx->Stencil._TestTwoSide =
+ ctx->Stencil._Enabled = (ctx->Stencil.Enabled &&
+ ctx->DrawBuffer->Visual.stencilBits > 0);
+
+ ctx->Stencil._TestTwoSide =
+ ctx->Stencil._Enabled &&
(ctx->Stencil.Function[0] != ctx->Stencil.Function[face] ||
ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] ||
ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] ||