summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/stencil.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2000-10-30 13:31:59 +0000
committerKeith Whitwell <[email protected]>2000-10-30 13:31:59 +0000
commita96308c37db0bc0086a017d318bc3504aa5f0b1a (patch)
tree0010de3aa19901acf13b57e57e7ba465abffa95e /src/mesa/main/stencil.c
parenta4575499679d9d91055a35c7673b81872ec127cb (diff)
Replace the flags Mesa was using for ctx->NewState with a new set
based on the GL attribute groups. Introduced constants describing the circumstances under which some key derived values can change: _SWRAST_NEW_RASTERMASK -- ctx->RasterMask _SWRAST_NEW_TRIANGLE -- The software rasterizer's triangle function _DD_NEW_FEEDBACK -- the 'DD_FEEDBACK' bit in ctx->TriangleCaps These are helpful in deciding whether you need to recalculate state if your recalculation involves reference to a derived value.
Diffstat (limited to 'src/mesa/main/stencil.c')
-rw-r--r--src/mesa/main/stencil.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index a2c8bf4e957..2dcecced563 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -1,4 +1,4 @@
-/* $Id: stencil.c,v 1.20 2000/10/29 18:23:16 brianp Exp $ */
+/* $Id: stencil.c,v 1.21 2000/10/30 13:32:01 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -48,6 +48,7 @@ _mesa_ClearStencil( GLint s )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearStencil");
ctx->Stencil.Clear = (GLstencil) s;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.ClearStencil) {
(*ctx->Driver.ClearStencil)( ctx, s );
@@ -83,6 +84,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
maxref = (1 << STENCIL_BITS) - 1;
ctx->Stencil.Ref = (GLstencil) CLAMP( ref, 0, maxref );
ctx->Stencil.ValueMask = (GLstencil) mask;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.StencilFunc) {
(*ctx->Driver.StencilFunc)( ctx, func, ctx->Stencil.Ref, mask );
@@ -97,6 +99,7 @@ _mesa_StencilMask( GLuint mask )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilMask");
ctx->Stencil.WriteMask = (GLstencil) mask;
+ ctx->NewState |= _NEW_STENCIL;
if (ctx->Driver.StencilMask) {
(*ctx->Driver.StencilMask)( ctx, mask );
@@ -121,7 +124,7 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.FailFunc = fail;
break;
}
@@ -141,7 +144,7 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.ZFailFunc = zfail;
break;
}
@@ -161,7 +164,7 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
break;
case GL_INCR_WRAP_EXT:
case GL_DECR_WRAP_EXT:
- if (ctx->Extensions.HaveStencilWrap) {
+ if (ctx->Extensions.EXT_stencil_wrap) {
ctx->Stencil.ZPassFunc = zpass;
break;
}
@@ -171,6 +174,8 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
return;
}
+ ctx->NewState |= _NEW_STENCIL;
+
if (ctx->Driver.StencilOp) {
(*ctx->Driver.StencilOp)(ctx, fail, zfail, zpass);
}