summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_tritemp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_tritemp.h')
-rw-r--r--src/mesa/swrast/s_tritemp.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index cded4a6c1c..c609210c0e 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -136,7 +136,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
EdgeT eMaj, eTop, eBot;
GLfloat oneOverArea;
const SWvertex *vMin, *vMid, *vMax; /* Y(vMin)<=Y(vMid)<=Y(vMax) */
- GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
+ GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
const GLint snapMask = ~((FIXED_ONE / (1 << SUB_PIXEL_BITS)) - 1); /* for x/y coord snapping */
GLfixed vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy;
@@ -235,6 +235,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
{
const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
/* Do backface culling */
+
if (area * bf < 0.0)
return;
@@ -242,10 +243,10 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
return;
oneOverArea = 1.0F / area;
- }
-
- span.facing = ctx->_Facing; /* for 2-sided stencil test */
+ /* 0 = front, 1 = back */
+ span.facing = oneOverArea * swrast->_BackfaceSign > 0.0F;
+ }
/* Edge setup. For a triangle strip these could be reused... */
{