summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2008-04-04 01:59:38 +0200
committerRoland Scheidegger <sroland@tungstengraphics.com>2008-04-04 12:44:13 +0200
commitcf9b07ea3474cd33e797eeb10b3fd73ad54ae8d5 (patch)
tree987a61fa1d56d2e33327fcfa0b1a6909c23aea0d /src/mesa
parent7a7bce7b24ea4f63faa1d5bfe3f71d09b412c838 (diff)
gallium: fix two-side stencil handling
Previously all drivers were in twosided mode since they checked for stencil.enable[1] flag which was a copy of stencil.enable[0]. Note that drivers should not reference stencil[1] state (other than the enable) if twosided stenciling is disabled (for now the stencil state is still copied but for instance clear_with_quads won't provide useful values in there). Also, use _TestTwoSide instead of TestTwoSide since results would be bogus otherwise if using APIs with implicit two side stencil enable (i.e. core ogl 2.0).
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_depth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
index 03057e37fa..ef467582c0 100644
--- a/src/mesa/state_tracker/st_atom_depth.c
+++ b/src/mesa/state_tracker/st_atom_depth.c
@@ -115,7 +115,7 @@ update_depth_stencil_alpha(struct st_context *st)
dsa->stencil[0].value_mask = st->ctx->Stencil.ValueMask[0] & 0xff;
dsa->stencil[0].write_mask = st->ctx->Stencil.WriteMask[0] & 0xff;
- if (st->ctx->Stencil.TestTwoSide) {
+ if (st->ctx->Stencil._TestTwoSide) {
dsa->stencil[1].enabled = 1;
dsa->stencil[1].func = st_compare_func_to_pipe(st->ctx->Stencil.Function[1]);
dsa->stencil[1].fail_op = gl_stencil_op_to_pipe(st->ctx->Stencil.FailFunc[1]);
@@ -127,6 +127,7 @@ update_depth_stencil_alpha(struct st_context *st)
}
else {
dsa->stencil[1] = dsa->stencil[0];
+ dsa->stencil[1].enabled = 0;
}
}