summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_span.c11
-rw-r--r--src/mesa/swrast/s_stencil.c10
-rw-r--r--src/mesa/swrast/s_stencil.h4
-rw-r--r--src/mesa/swrast/s_tritemp.h3
-rw-r--r--src/mesa/swrast/swrast.h6
5 files changed, 19 insertions, 15 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 74fccc55c7..b134890a3b 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1,4 +1,4 @@
-/* $Id: s_span.c,v 1.47 2002/09/06 02:56:09 brianp Exp $ */
+/* $Id: s_span.c,v 1.48 2002/10/02 23:24:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -803,8 +803,7 @@ _mesa_write_index_span( GLcontext *ctx, struct sw_span *span)
_mesa_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- const GLuint face = 0; /* XXX stencil two side */
- if (!_mesa_stencil_and_ztest_span(ctx, span, face)) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
@@ -983,8 +982,7 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span)
_mesa_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- const GLuint face = 0; /* XXX stencil two side */
- if (!_mesa_stencil_and_ztest_span(ctx, span, face)) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
return;
@@ -1214,8 +1212,7 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span)
_mesa_span_interpolate_z(ctx, span);
if (ctx->Stencil.Enabled) {
- const GLuint face = 0; /* XXX stencil two side */
- if (!_mesa_stencil_and_ztest_span(ctx, span, face)) {
+ if (!_mesa_stencil_and_ztest_span(ctx, span)) {
span->arrayMask = origArrayMask;
return;
}
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 4ec64ee848..90ff06c951 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.c,v 1.26 2002/09/06 02:56:09 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.27 2002/10/02 23:24:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1006,12 +1006,14 @@ stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face )
* GL_FALSE = all fragments failed.
*/
GLboolean
-_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
+_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span)
{
+ /* span->facing can only be non-zero if using two-sided stencil */
+ ASSERT(ctx->Stencil.TestTwoSide || span->facing == 0);
if (span->arrayMask & SPAN_XY)
- return stencil_and_ztest_pixels(ctx, span, face);
+ return stencil_and_ztest_pixels(ctx, span, span->facing);
else
- return stencil_and_ztest_span(ctx, span, face);
+ return stencil_and_ztest_span(ctx, span, span->facing);
}
diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h
index ec76edaf78..b174f2e01e 100644
--- a/src/mesa/swrast/s_stencil.h
+++ b/src/mesa/swrast/s_stencil.h
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.h,v 1.8 2002/09/06 02:56:09 brianp Exp $ */
+/* $Id: s_stencil.h,v 1.9 2002/10/02 23:24:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,7 +35,7 @@
extern GLboolean
-_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face);
+_mesa_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span);
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 726f17e9bb..ef5e00eb5b 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_tritemp.h,v 1.38 2002/08/07 15:18:42 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.39 2002/10/02 23:24:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -215,6 +215,7 @@
#ifndef DO_OCCLUSION_TEST
ctx->OcclusionResult = GL_TRUE;
#endif
+ span.facing = ctx->_Facing; /* for 2-sided stencil test */
/* Edge setup. For a triangle strip these could be reused... */
{
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 4db055b6fe..2d547c889e 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -1,4 +1,4 @@
-/* $Id: swrast.h,v 1.27 2002/09/17 15:46:36 brianp Exp $ */
+/* $Id: swrast.h,v 1.28 2002/10/02 23:24:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -147,6 +147,9 @@ struct sw_span {
/** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */
GLenum primitive;
+ /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */
+ GLuint facing;
+
/**
* This bitmask (of SPAN_* flags) indicates which of the x/xStep
* variables are relevant.
@@ -201,6 +204,7 @@ do { \
(S).arrayMask = (ARRAY_MASK); \
(S).start = 0; \
(S).end = (END); \
+ (S).facing = 0; \
(S).array = SWRAST_CONTEXT(ctx)->span_data; \
} while (0)