summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorDaniel Borca <dborca@users.sourceforge.net>2004-11-12 09:56:33 +0000
committerDaniel Borca <dborca@users.sourceforge.net>2004-11-12 09:56:33 +0000
commit79a98dea915463803ee13768ee0cacf9b547d963 (patch)
tree252e4df58b8e936b0bd12b4cce5e6b5eff9be3ff /src/mesa
parenta2c2393d9185030bded93311880a770aa62f931d (diff)
pop(stencil) for EXT_stencil_two_side
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/attrib.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 37fcef5113..658b4ba013 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1060,17 +1060,26 @@ _mesa_PopAttrib(void)
break;
case GL_STENCIL_BUFFER_BIT:
{
- const GLint face = 0; /* XXX stencil two side */
+ GLint face;
const struct gl_stencil_attrib *stencil;
stencil = (const struct gl_stencil_attrib *) attr->data;
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
_mesa_ClearStencil(stencil->Clear);
- _mesa_StencilFunc(stencil->Function[face], stencil->Ref[face],
- stencil->ValueMask[face]);
- _mesa_StencilMask(stencil->WriteMask[face]);
- _mesa_StencilOp(stencil->FailFunc[face],
- stencil->ZFailFunc[face],
- stencil->ZPassFunc[face]);
+ face = stencil->ActiveFace;
+ if (ctx->Extensions.EXT_stencil_two_side) {
+ _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, stencil->TestTwoSide);
+ face ^= 1;
+ }
+ do {
+ _mesa_ActiveStencilFaceEXT(face);
+ _mesa_StencilFunc(stencil->Function[face], stencil->Ref[face],
+ stencil->ValueMask[face]);
+ _mesa_StencilMask(stencil->WriteMask[face]);
+ _mesa_StencilOp(stencil->FailFunc[face],
+ stencil->ZFailFunc[face],
+ stencil->ZPassFunc[face]);
+ face ^= 1;
+ } while (face != stencil->ActiveFace ^ 1);
}
break;
case GL_TRANSFORM_BIT: