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.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index cded4a6c1c..8e3c5b5eeb 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -234,18 +234,18 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
/* compute area, oneOverArea and perform backface culling */
{
const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
- /* Do backface culling */
- if (area * bf < 0.0)
- return;
if (IS_INF_OR_NAN(area) || area == 0.0F)
return;
- oneOverArea = 1.0F / area;
- }
+ 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... */
{