From fcd7c37fd3d0f61cf6ac81170bc0b3fca64ad9bb Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 30 Nov 2007 13:01:57 -0700 Subject: fix broken two-sided stencil --- src/mesa/swrast/s_context.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 3956925651..3bf9804bef 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -117,8 +117,8 @@ _swrast_update_rasterflags( GLcontext *ctx ) /** - * Examine polycon culls tate to compute the _BackfaceSign field. - * _BackfaceSign will be 0 if no culling, -1 if culling back-faces, + * Examine polycon culls tate to compute the _BackfaceCullSign field. + * _BackfaceCullSign will be 0 if no culling, -1 if culling back-faces, * and 1 if culling front-faces. The Polygon FrontFace state also * factors in. */ @@ -149,10 +149,15 @@ _swrast_update_polygon( GLcontext *ctx ) backface_sign = 0.0; } - SWRAST_CONTEXT(ctx)->_BackfaceSign = backface_sign; + SWRAST_CONTEXT(ctx)->_BackfaceCullSign = backface_sign; + + /* This is for front/back-face determination, but not for culling */ + SWRAST_CONTEXT(ctx)->_BackfaceSign + = (ctx->Polygon.FrontFace == GL_CW) ? -1.0 : 1.0; } + /** * Update the _PreferPixelFog field to indicate if we need to compute * fog blend factors (from the fog coords) per-fragment. @@ -763,6 +768,12 @@ _swrast_ResetLineStipple( GLcontext *ctx ) SWRAST_CONTEXT(ctx)->StippleCounter = 0; } +void +_swrast_SetFacing(GLcontext *ctx, GLuint facing) +{ + SWRAST_CONTEXT(ctx)->PointLineFacing = facing; +} + void _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value ) { -- cgit v1.2.3