diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-20 18:33:30 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-21 08:47:18 +0200 |
commit | db967dcb05cbae2d153122609df78b737852fc5c (patch) | |
tree | e8873ba1bcfd2454241308e53bd7bfc3967c7906 /src/mesa | |
parent | b9e2d5c18d3edc7cdd2e8df3d6d0aae7daeff57e (diff) |
mesa: add stencil_func() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/stencil.c | 30 | ||||
-rw-r--r-- | src/mesa/main/stencil.h | 2 |
2 files changed, 20 insertions, 12 deletions
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 |