summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_cc.c
diff options
context:
space:
mode:
authorIan Romanick <idr@freedesktop.org>2009-01-09 15:43:17 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-01-23 09:49:29 -0800
commitdde7cb962860e72e1bf3175069767358cc5b3f3c (patch)
tree64ca81d4f544ae7f28618c919af58a844f246de9 /src/mesa/drivers/dri/i965/brw_cc.c
parentaf0e6336e9d7dc19d74950ce13b33e1fa1b2081d (diff)
Track two sets of back-face stencil state
Track separate back-face stencil state for OpenGL 2.0 / GL_ATI_separate_stencil and GL_EXT_stencil_two_side. This allows all three to be enabled in a driver. One set of state is set via the 2.0 or ATI functions and is used when STENCIL_TEST_TWO_SIDE_EXT is disabled. The other is set by StencilFunc and StencilOp when the active stencil face is set to BACK. The GL_EXT_stencil_two_side spec has more details. http://opengl.org/registry/specs/EXT/stencil_two_side.txt
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_cc.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_cc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c
index fa8121e02d..abae4b3215 100644
--- a/src/mesa/drivers/dri/i965/brw_cc.c
+++ b/src/mesa/drivers/dri/i965/brw_cc.c
@@ -84,6 +84,7 @@ static void
cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key)
{
struct gl_stencil_attrib *stencil = brw->attribs.Stencil;
+ const unsigned back = stencil->_BackFace;
memset(key, 0, sizeof(*key));
@@ -100,13 +101,13 @@ cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key)
key->stencil_test_mask[0] = stencil->ValueMask[0];
}
if (key->stencil_two_side) {
- key->stencil_func[1] = stencil->Function[1];
- key->stencil_fail_op[1] = stencil->FailFunc[1];
- key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[1];
- key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[1];
- key->stencil_ref[1] = stencil->Ref[1];
- key->stencil_write_mask[1] = stencil->WriteMask[1];
- key->stencil_test_mask[1] = stencil->ValueMask[1];
+ key->stencil_func[1] = stencil->Function[back];
+ key->stencil_fail_op[1] = stencil->FailFunc[back];
+ key->stencil_pass_depth_fail_op[1] = stencil->ZFailFunc[back];
+ key->stencil_pass_depth_pass_op[1] = stencil->ZPassFunc[back];
+ key->stencil_ref[1] = stencil->Ref[back];
+ key->stencil_write_mask[1] = stencil->WriteMask[back];
+ key->stencil_test_mask[1] = stencil->ValueMask[back];
}
if (brw->attribs.Color->_LogicOpEnabled)