diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-20 18:16:05 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-21 08:47:10 +0200 |
commit | 8ab0aaa3507247c8cddace7e2eee02382beebf34 (patch) | |
tree | 7f2b7e812740b66ea3a936838927254137c60066 | |
parent | 9c49c9d8ddac5be2cc399a62e48257b21d7922e9 (diff) |
mesa: add stencil_mask_separate() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r-- | src/mesa/main/stencil.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 0b7e151ad13..497fffafbe3 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -506,6 +506,25 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) } +static void +stencil_mask_separate(struct gl_context *ctx, GLenum face, GLuint mask) +{ + FLUSH_VERTICES(ctx, _NEW_STENCIL); + + if (face != GL_BACK) { + ctx->Stencil.WriteMask[0] = mask; + } + + if (face != GL_FRONT) { + ctx->Stencil.WriteMask[1] = mask; + } + + if (ctx->Driver.StencilMaskSeparate) { + ctx->Driver.StencilMaskSeparate(ctx, face, mask); + } +} + + /* OpenGL 2.0 */ void GLAPIENTRY _mesa_StencilMaskSeparate(GLenum face, GLuint mask) @@ -520,17 +539,7 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask) return; } - FLUSH_VERTICES(ctx, _NEW_STENCIL); - - if (face != GL_BACK) { - ctx->Stencil.WriteMask[0] = mask; - } - if (face != GL_FRONT) { - ctx->Stencil.WriteMask[1] = mask; - } - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, face, mask); - } + stencil_mask_separate(ctx, face, mask); } |