summaryrefslogtreecommitdiff
path: root/src/mesa/swrast_setup/ss_triangle.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-10-29 22:25:57 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-10-29 22:25:57 +0000
commit46b3f976542190dd3c217a46653159f77552764a (patch)
tree2d1f169037ec04cbf4bc44ed8470ee2b6fd6d2e8 /src/mesa/swrast_setup/ss_triangle.c
parent05a4b37707d2c598ea68c05d07a3d65bcbf5a076 (diff)
fix culling problem (bug 630649)
Diffstat (limited to 'src/mesa/swrast_setup/ss_triangle.c')
-rw-r--r--src/mesa/swrast_setup/ss_triangle.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c
index 9633469df1..d2f140f7ff 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.19 2002/10/29 20:29:00 brianp Exp $ */
+/* $Id: ss_triangle.c,v 1.20 2002/10/29 22:25:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -48,7 +48,8 @@ static quad_func quad_tab[SS_MAX_TRIFUNC];
static void _swsetup_render_line_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
@@ -61,6 +62,14 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);
@@ -98,7 +107,8 @@ static void _swsetup_render_line_tri( GLcontext *ctx,
}
static void _swsetup_render_point_tri( GLcontext *ctx,
- GLuint e0, GLuint e1, GLuint e2 )
+ GLuint e0, GLuint e1, GLuint e2,
+ GLuint facing )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
@@ -111,6 +121,14 @@ static void _swsetup_render_point_tri( GLcontext *ctx,
GLchan s[2][4];
GLuint i[2];
+ /* cull testing */
+ if (ctx->Polygon.CullFlag) {
+ if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT)
+ return;
+ if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK)
+ return;
+ }
+
if (ctx->_TriangleCaps & DD_FLATSHADE) {
COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color);