diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-11-30 13:01:57 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-11-30 13:01:57 -0700 |
commit | fcd7c37fd3d0f61cf6ac81170bc0b3fca64ad9bb (patch) | |
tree | 4d914939e75c09c6d3592403b34cdf0ce044e361 /src/mesa/swrast_setup | |
parent | 44c8dac0af8ae679b25b458980ce97d8ff410766 (diff) |
fix broken two-sided stencil
Diffstat (limited to 'src/mesa/swrast_setup')
-rw-r--r-- | src/mesa/swrast_setup/ss_context.c | 3 | ||||
-rw-r--r-- | src/mesa/swrast_setup/ss_triangle.c | 10 | ||||
-rw-r--r-- | src/mesa/swrast_setup/ss_tritmp.h | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index a9c7d941e5..a4f949ddfe 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -201,6 +201,9 @@ _swsetup_RenderStart( GLcontext *ctx ) swsetup->NewState = 0; + /* This will change if drawing unfilled tris */ + _swrast_SetFacing(ctx, 0); + _swrast_render_start(ctx); /* Important */ diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index b4207f2c64..4817d23932 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 7.1 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -68,6 +68,8 @@ static void _swsetup_render_line_tri( GLcontext *ctx, return; } + _swrast_SetFacing(ctx, facing); + if (ctx->Light.ShadeModel == GL_FLAT) { COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[1], v1->color); @@ -127,6 +129,8 @@ static void _swsetup_render_point_tri( GLcontext *ctx, return; } + _swrast_SetFacing(ctx, facing); + if (ctx->Light.ShadeModel == GL_FLAT) { /* save colors/indexes for v0, v1 vertices */ COPY_CHAN4(c[0], v0->color); @@ -311,6 +315,4 @@ void _swsetup_choose_trifuncs( GLcontext *ctx ) tnl->Driver.Render.Quad = quad_tab[ind]; tnl->Driver.Render.Line = swsetup_line; tnl->Driver.Render.Points = swsetup_points; - - ctx->_Facing = 0; } diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 7d1bc23465..97d2f4a16b 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -49,7 +49,6 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) v[1] = &verts[e1]; v[2] = &verts[e2]; - if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT)) { GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; @@ -61,7 +60,6 @@ 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; if (IND & SS_UNFILLED_BIT) mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode; |