diff options
author | Brian Paul <[email protected]> | 2000-08-30 18:21:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-08-30 18:21:06 +0000 |
commit | 8e053916c8052b47c191f68991c126f47c72c3f3 (patch) | |
tree | 56ce72c5a4958145c18030cabe7d10c9f1cb8b98 /src/mesa/main/stencil.c | |
parent | 289d47eee5342bd7ec1c25a29d9bdc8d6f9dc4ed (diff) |
added more extensions testing code
Diffstat (limited to 'src/mesa/main/stencil.c')
-rw-r--r-- | src/mesa/main/stencil.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index e07e1833ae8..c1d8bb29b3c 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,4 +1,4 @@ -/* $Id: stencil.c,v 1.16 2000/04/11 21:26:57 brianp Exp $ */ +/* $Id: stencil.c,v 1.17 2000/08/30 18:23:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -105,7 +105,7 @@ _mesa_StencilMask( GLuint mask ) void -_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) +_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilOp"); @@ -116,12 +116,17 @@ _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) case GL_INCR: case GL_DECR: case GL_INVERT: - case GL_INCR_WRAP_EXT: - case GL_DECR_WRAP_EXT: ctx->Stencil.FailFunc = fail; break; + case GL_INCR_WRAP_EXT: + case GL_DECR_WRAP_EXT: + if (ctx->Extensions.HaveStencilWrap) { + ctx->Stencil.FailFunc = fail; + break; + } + /* FALL-THROUGH */ default: - gl_error( ctx, GL_INVALID_ENUM, "glStencilOp" ); + gl_error(ctx, GL_INVALID_ENUM, "glStencilOp"); return; } switch (zfail) { @@ -131,12 +136,17 @@ _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) case GL_INCR: case GL_DECR: case GL_INVERT: - case GL_INCR_WRAP_EXT: - case GL_DECR_WRAP_EXT: ctx->Stencil.ZFailFunc = zfail; break; + case GL_INCR_WRAP_EXT: + case GL_DECR_WRAP_EXT: + if (ctx->Extensions.HaveStencilWrap) { + ctx->Stencil.ZFailFunc = zfail; + break; + } + /* FALL-THROUGH */ default: - gl_error( ctx, GL_INVALID_ENUM, "glStencilOp" ); + gl_error(ctx, GL_INVALID_ENUM, "glStencilOp"); return; } switch (zpass) { @@ -146,17 +156,22 @@ _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) case GL_INCR: case GL_DECR: case GL_INVERT: - case GL_INCR_WRAP_EXT: - case GL_DECR_WRAP_EXT: ctx->Stencil.ZPassFunc = zpass; break; + case GL_INCR_WRAP_EXT: + case GL_DECR_WRAP_EXT: + if (ctx->Extensions.HaveStencilWrap) { + ctx->Stencil.ZPassFunc = zpass; + break; + } + /* FALL-THROUGH */ default: - gl_error( ctx, GL_INVALID_ENUM, "glStencilOp" ); + gl_error(ctx, GL_INVALID_ENUM, "glStencilOp"); return; } if (ctx->Driver.StencilOp) { - (*ctx->Driver.StencilOp)( ctx, fail, zfail, zpass ); + (*ctx->Driver.StencilOp)(ctx, fail, zfail, zpass); } } |