summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-11-30 13:01:57 -0700
committerBrian <[email protected]>2007-11-30 13:01:57 -0700
commitfcd7c37fd3d0f61cf6ac81170bc0b3fca64ad9bb (patch)
tree4d914939e75c09c6d3592403b34cdf0ce044e361 /src/mesa/swrast/s_context.c
parent44c8dac0af8ae679b25b458980ce97d8ff410766 (diff)
fix broken two-sided stencil
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 39569256514..3bf9804befc 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.
@@ -764,6 +769,12 @@ _swrast_ResetLineStipple( GLcontext *ctx )
}
void
+_swrast_SetFacing(GLcontext *ctx, GLuint facing)
+{
+ SWRAST_CONTEXT(ctx)->PointLineFacing = facing;
+}
+
+void
_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
{
if (SWRAST_DEBUG) {