From: Samuel Pitoiset Date: Tue, 20 Jun 2017 16:33:30 +0000 (+0200) Subject: mesa: add stencil_func() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db967dcb05cbae2d153122609df78b737852fc5c;p=mesa.git mesa: add stencil_func() helper Signed-off-by: Samuel Pitoiset Reviewed-by: Timothy Arceri --- diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index d7e94194012..4c35b2d20d7 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -184,20 +184,11 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies * the driver via the dd_function_table::StencilFunc callback. */ -void GLAPIENTRY -_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) +static void +stencil_func(struct gl_context *ctx, GLenum func, GLint ref, GLuint mask) { - GET_CURRENT_CONTEXT(ctx); const GLint face = ctx->Stencil.ActiveFace; - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilFunc()\n"); - - if (!validate_stencil_func(ctx, func)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)"); - return; - } - if (face != 0) { if (ctx->Stencil.Function[face] == func && ctx->Stencil.ValueMask[face] == mask && @@ -238,6 +229,23 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) } +void GLAPIENTRY +_mesa_StencilFunc(GLenum func, GLint ref, GLuint mask) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glStencilFunc()\n"); + + if (!validate_stencil_func(ctx, func)) { + _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)"); + return; + } + + stencil_func(ctx, func, ref, mask); +} + + /** * Set the stencil writing mask. * diff --git a/src/mesa/main/stencil.h b/src/mesa/main/stencil.h index 87708e009c9..a7a2210ac9b 100644 --- a/src/mesa/main/stencil.h +++ b/src/mesa/main/stencil.h @@ -42,7 +42,7 @@ _mesa_ClearStencil( GLint s ); extern void GLAPIENTRY -_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ); +_mesa_StencilFunc(GLenum func, GLint ref, GLuint mask); extern void GLAPIENTRY