diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/stencil.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index b303bb7c13f..78a09072b29 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -448,24 +448,10 @@ _mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) } -/* OpenGL 2.0 */ -void GLAPIENTRY -_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) +static void +stencil_func_separate(struct gl_context *ctx, GLenum face, GLenum func, + GLint ref, GLuint mask) { - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilFuncSeparate()\n"); - - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)"); - return; - } - if (!validate_stencil_func(ctx, func)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)"); - return; - } - FLUSH_VERTICES(ctx, _NEW_STENCIL); if (face != GL_BACK) { @@ -474,12 +460,14 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) ctx->Stencil.Ref[0] = ref; ctx->Stencil.ValueMask[0] = mask; } + if (face != GL_FRONT) { /* set back */ ctx->Stencil.Function[1] = func; ctx->Stencil.Ref[1] = ref; ctx->Stencil.ValueMask[1] = mask; } + if (ctx->Driver.StencilFuncSeparate) { ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask); } @@ -488,6 +476,29 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) /* OpenGL 2.0 */ void GLAPIENTRY +_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glStencilFuncSeparate()\n"); + + if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { + _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)"); + return; + } + + if (!validate_stencil_func(ctx, func)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)"); + return; + } + + stencil_func_separate(ctx, face, func, ref, mask); +} + + +/* OpenGL 2.0 */ +void GLAPIENTRY _mesa_StencilMaskSeparate(GLenum face, GLuint mask) { GET_CURRENT_CONTEXT(ctx); |