diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-13 04:42:09 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-13 04:42:09 +0000 |
commit | 878c371e6cf6eb28afacc482d8aeaa0119f00d5b (patch) | |
tree | 61c5d8f5e55e426e51a8601566e2a6a71ebf7415 /src/mesa/main | |
parent | 42c34efd23d7ad05df9f3c71f7d52dd259e179d8 (diff) |
Replace ctx->Driver.StencilOp/Func/Mask() functions with
ctx->Driver.Stencil*Separate() functions.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/attrib.c | 17 | ||||
-rw-r--r-- | src/mesa/main/dd.h | 10 | ||||
-rw-r--r-- | src/mesa/main/stencil.c | 39 |
3 files changed, 33 insertions, 33 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index a9786db27a0..b98d40c65a2 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1081,14 +1081,17 @@ _mesa_PopAttrib(void) ? GL_BACK : GL_FRONT); } /* front state */ - _mesa_StencilFunc(stencil->Function[0], stencil->Ref[0], - stencil->ValueMask[0]); - _mesa_StencilMask(stencil->WriteMask[0]); - _mesa_StencilOp(stencil->FailFunc[0], - stencil->ZFailFunc[0], - stencil->ZPassFunc[0]); + _mesa_StencilFuncSeparate(GL_FRONT, + stencil->Function[0], + stencil->Ref[0], + stencil->ValueMask[0]); + _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]); + _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0], + stencil->ZFailFunc[0], + stencil->ZPassFunc[0]); /* back state */ - _mesa_StencilFuncSeparate(GL_BACK, stencil->Function[1], + _mesa_StencilFuncSeparate(GL_BACK, + stencil->Function[1], stencil->Ref[1], stencil->ValueMask[1]); _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]); diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 0b4903629c2..55bb66cb018 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -5,7 +5,7 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * @@ -687,14 +687,6 @@ struct dd_function_table { void (*Scissor)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); /** Select flat or smooth shading */ void (*ShadeModel)(GLcontext *ctx, GLenum mode); - /** Set function and reference value for stencil testing */ - void (*StencilFunc)(GLcontext *ctx, GLenum func, GLint ref, GLuint mask); - /** Control the writing of individual bits in the stencil planes */ - void (*StencilMask)(GLcontext *ctx, GLuint mask); - /** Set stencil test actions */ - void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass); - /** Set active stencil face (GL_EXT_stencil_two_side) */ - void (*ActiveStencilFace)(GLcontext *ctx, GLuint face); /** OpenGL 2.0 two-sided StencilFunc */ void (*StencilFuncSeparate)(GLcontext *ctx, GLenum face, GLenum func, GLint ref, GLuint mask); diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 1adfac2dbc7..f03d94eb8f7 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -127,6 +127,10 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Function[face] = func; ctx->Stencil.Ref[face] = ref; ctx->Stencil.ValueMask[face] = mask; + if (ctx->Driver.StencilFuncSeparate) { + ctx->Driver.StencilFuncSeparate(ctx, face ? GL_BACK : GL_FRONT, + func, ref, mask); + } } else { /* set both front and back state */ @@ -141,10 +145,10 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func; ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; - } - - if (ctx->Driver.StencilFunc) { - ctx->Driver.StencilFunc( ctx, func, ref, mask ); + if (ctx->Driver.StencilFuncSeparate) { + ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT_AND_BACK, + func, ref, mask); + } } } @@ -173,6 +177,9 @@ _mesa_StencilMask( GLuint mask ) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[face] = mask; + if (ctx->Driver.StencilMaskSeparate) { + ctx->Driver.StencilMaskSeparate(ctx, face ? GL_BACK : GL_FRONT, mask); + } } else { /* set both front and back state */ @@ -181,10 +188,9 @@ _mesa_StencilMask( GLuint mask ) return; FLUSH_VERTICES(ctx, _NEW_STENCIL); ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; - } - - if (ctx->Driver.StencilMask) { - ctx->Driver.StencilMask( ctx, mask ); + if (ctx->Driver.StencilMaskSeparate) { + ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT_AND_BACK, mask); + } } } @@ -275,6 +281,10 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZFailFunc[face] = zfail; ctx->Stencil.ZPassFunc[face] = zpass; ctx->Stencil.FailFunc[face] = fail; + if (ctx->Driver.StencilOpSeparate) { + ctx->Driver.StencilOpSeparate(ctx, face ? GL_BACK : GL_FRONT, + fail, zfail, zpass); + } } else { /* set both front and back state */ @@ -289,10 +299,10 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail; ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass; ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail; - } - - if (ctx->Driver.StencilOp) { - ctx->Driver.StencilOp(ctx, fail, zfail, zpass); + if (ctx->Driver.StencilOpSeparate) { + ctx->Driver.StencilOpSeparate(ctx, GL_FRONT_AND_BACK, + fail, zfail, zpass); + } } } @@ -317,11 +327,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face) } else { _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); - return; - } - - if (ctx->Driver.ActiveStencilFace) { - ctx->Driver.ActiveStencilFace(ctx, (GLuint) ctx->Stencil.ActiveFace); } } #endif |