From dde7cb962860e72e1bf3175069767358cc5b3f3c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 9 Jan 2009 15:43:17 -0800 Subject: 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 --- src/mesa/swrast/s_stencil.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index c925922463..2e84ddec71 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -997,10 +997,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) GLboolean _swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span) { + const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace; + if (span->arrayMask & SPAN_XY) - return stencil_and_ztest_pixels(ctx, span, span->facing); + return stencil_and_ztest_pixels(ctx, span, face); else - return stencil_and_ztest_span(ctx, span, span->facing); + return stencil_and_ztest_span(ctx, span, face); } -- cgit v1.2.3