aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/stencil.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-20 04:31:24 +0000
committerBrian Paul <[email protected]>2005-09-20 04:31:24 +0000
commit22607975b49633a38ddf65127e26a30e9522d825 (patch)
treee2b71bcc6266ff88cc8f280d76ea211698d160cd /src/mesa/main/stencil.c
parent3211b28ee633707218fe7eb2bdfc604c10fd8d29 (diff)
replace STENCIL_BITS with stencilMax value
Diffstat (limited to 'src/mesa/main/stencil.c')
-rw-r--r--src/mesa/main/stencil.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index f03d94eb8f7..6b4d7e81eb8 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -95,7 +95,7 @@ void GLAPIENTRY
_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
{
GET_CURRENT_CONTEXT(ctx);
- GLint maxref;
+ const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (func) {
@@ -113,8 +113,7 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
return;
}
- maxref = (1 << STENCIL_BITS) - 1;
- ref = CLAMP( ref, 0, maxref );
+ ref = CLAMP( ref, 0, stencilMax );
if (ctx->Extensions.EXT_stencil_two_side) {
/* only set active face state */
@@ -429,7 +428,7 @@ void GLAPIENTRY
_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
GET_CURRENT_CONTEXT(ctx);
- GLint maxref;
+ const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
@@ -452,8 +451,7 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
return;
}
- maxref = (1 << STENCIL_BITS) - 1;
- ref = CLAMP(ref, 0, maxref);
+ ref = CLAMP(ref, 0, stencilMax);
FLUSH_VERTICES(ctx, _NEW_STENCIL);