summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-03-24 19:59:59 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-03-24 19:59:59 -0600
commitd453042bc67cc94bb215d229b60e8cd70a80ff8d (patch)
tree63329d4c8afd2c5198058259dbe31635958c8319
parent6579440ea98e61871fe781c1c9c681645ddcc075 (diff)
gallium: don't enable stencil test if no stencil buffer.
Also, if not doing two-sided stencil, set back-face state = front-face state.
-rw-r--r--src/mesa/state_tracker/st_atom_depth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
index 827ad3b548..03057e37fa 100644
--- a/src/mesa/state_tracker/st_atom_depth.c
+++ b/src/mesa/state_tracker/st_atom_depth.c
@@ -105,7 +105,7 @@ update_depth_stencil_alpha(struct st_context *st)
st->ctx->Query.CurrentOcclusionObject->Active)
dsa->depth.occlusion_count = 1;
- if (st->ctx->Stencil.Enabled) {
+ if (st->ctx->Stencil.Enabled && st->ctx->Visual.stencilBits > 0) {
dsa->stencil[0].enabled = 1;
dsa->stencil[0].func = st_compare_func_to_pipe(st->ctx->Stencil.Function[0]);
dsa->stencil[0].fail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.FailFunc[0]);
@@ -125,6 +125,9 @@ update_depth_stencil_alpha(struct st_context *st)
dsa->stencil[1].value_mask = st->ctx->Stencil.ValueMask[1] & 0xff;
dsa->stencil[1].write_mask = st->ctx->Stencil.WriteMask[1] & 0xff;
}
+ else {
+ dsa->stencil[1] = dsa->stencil[0];
+ }
}
if (st->ctx->Color.AlphaEnabled) {