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.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index dcc3e958cb1..891eaf6787a 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -292,18 +292,17 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#else
const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
#endif
- /* Do backface culling */
- if (area * bf < 0.0)
+ if (IS_INF_OR_NAN(area) || area == 0.0F)
return;
- if (IS_INF_OR_NAN(area) || area == 0.0F)
+ if (area * bf * swrast->_BackfaceCullSign < 0.0)
return;
oneOverArea = 1.0F / area;
- }
-
- span.facing = ctx->_Facing; /* for 2-sided stencil test */
+ /* 0 = front, 1 = back */
+ span.facing = oneOverArea * bf > 0.0F;
+ }
/* Edge setup. For a triangle strip these could be reused... */
{