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).
unsigned occlusion_count:1; /**< do occlusion counting? */
} depth;
struct {
- unsigned enabled:1;
+ unsigned enabled:1; /**< stencil[0]: stencil enabled, stencil[1]: two-side enabled */
unsigned func:3; /**< PIPE_FUNC_x */
unsigned fail_op:3; /**< PIPE_STENCIL_OP_x */
unsigned zpass_op:3; /**< PIPE_STENCIL_OP_x */
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]);
}
else {
dsa->stencil[1] = dsa->stencil[0];
+ dsa->stencil[1].enabled = 0;
}
}