summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/stencil.c47
-rw-r--r--src/mesa/main/stencil.h2
2 files changed, 29 insertions, 20 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index 82dd7870675..7913bb176e7 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -320,28 +320,11 @@ _mesa_StencilMask( GLuint mask )
* __struct gl_contextRec::Stencil. On change flushes the vertices and notifies
* the driver via the dd_function_table::StencilOp callback.
*/
-void GLAPIENTRY
-_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+static void
+stencil_op(struct gl_context *ctx, GLenum fail, GLenum zfail, GLenum zpass)
{
- GET_CURRENT_CONTEXT(ctx);
const GLint face = ctx->Stencil.ActiveFace;
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glStencilOp()\n");
-
- if (!validate_stencil_op(ctx, fail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zfail)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zfail)");
- return;
- }
- if (!validate_stencil_op(ctx, zpass)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zpass)");
- return;
- }
-
if (face != 0) {
/* only set active face state */
if (ctx->Stencil.ZFailFunc[face] == zfail &&
@@ -383,6 +366,32 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
}
+void GLAPIENTRY
+_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glStencilOp()\n");
+
+ if (!validate_stencil_op(ctx, fail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)");
+ return;
+ }
+
+ if (!validate_stencil_op(ctx, zfail)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zfail)");
+ return;
+ }
+
+ if (!validate_stencil_op(ctx, zpass)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(zpass)");
+ return;
+ }
+
+ stencil_op(ctx, fail, zfail, zpass);
+}
+
/* GL_EXT_stencil_two_side */
void GLAPIENTRY
diff --git a/src/mesa/main/stencil.h b/src/mesa/main/stencil.h
index 71844712a28..5425065a7ca 100644
--- a/src/mesa/main/stencil.h
+++ b/src/mesa/main/stencil.h
@@ -53,7 +53,7 @@ _mesa_StencilMask( GLuint mask );
extern void GLAPIENTRY
-_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+_mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass);
extern void GLAPIENTRY