diff options
author | Brian Paul <[email protected]> | 2002-10-02 23:24:04 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-10-02 23:24:04 +0000 |
commit | be99e845bd7979fe46d38d9b294c1ba0a0aa95b8 (patch) | |
tree | 894e2807945dacf81c906a749a17534e62825489 /src/mesa/swrast_setup | |
parent | 0adce5d0ed20910a41c2115e4dd0173fdcc53cdb (diff) |
finished up GL_EXT_stencil_two_side
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r-- | src/mesa/swrast_setup/ss_triangle.c | 10 | ||||
-rw-r--r-- | src/mesa/swrast_setup/ss_tritmp.h | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 159dc799efc..fa1f3e74e90 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -1,4 +1,4 @@ -/* $Id: ss_triangle.c,v 1.16 2002/10/02 21:44:08 brianp Exp $ */ +/* $Id: ss_triangle.c,v 1.17 2002/10/02 23:24:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -273,9 +273,15 @@ void _swsetup_choose_trifuncs( GLcontext *ctx ) if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) ind |= SS_TWOSIDE_BIT; - if (ctx->_TriangleCaps & DD_TRI_UNFILLED) + /* We piggyback the two-sided stencil front/back determination on the + * unfilled triangle path. + */ + if ((ctx->_TriangleCaps & DD_TRI_UNFILLED) || + (ctx->Stencil.Enabled && ctx->Stencil.TestTwoSide)) ind |= SS_UNFILLED_BIT; + ctx->_Facing = 0; + if (ctx->Visual.rgbMode) ind |= SS_RGBA_BIT; diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 61d1f8008a4..2a1ff14cf9c 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -1,4 +1,4 @@ -/* $Id: ss_tritmp.h,v 1.15 2001/09/14 21:36:43 brianp Exp $ */ +/* $Id: ss_tritmp.h,v 1.16 2002/10/02 23:24:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -54,6 +54,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT)) { facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; + ctx->_Facing = facing; /* for 2-sided stencil test */ if (IND & SS_UNFILLED_BIT) mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode; |