Replace the flags Mesa was using for ctx->NewState with a new set
[mesa.git] / src / mesa / main / stencil.c
index bc14fed08daeeb9e9c25f6f39f0508eb333c8b70..2dcecced5634bfa56038563c00a80c7215731986 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stencil.c,v 1.19 2000/09/26 20:53:53 brianp Exp $ */
+/* $Id: stencil.c,v 1.21 2000/10/30 13:32:01 keithw Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -31,6 +31,7 @@
 #include "glheader.h"
 #include "context.h"
 #include "depth.h"
+#include "macros.h"
 #include "mem.h"
 #include "pb.h"
 #include "stencil.h"
@@ -47,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 );
@@ -82,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 );
@@ -96,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 );
@@ -120,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;
          }
@@ -140,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;
          }
@@ -160,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;
          }
@@ -170,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);
    }