From 3211b28ee633707218fe7eb2bdfc604c10fd8d29 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Sep 2005 04:25:03 +0000 Subject: [PATCH] remove STENCIL_MAX --- src/mesa/main/mtypes.h | 2 -- src/mesa/swrast/s_stencil.c | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0c3a63d2e3e..85b15b8399e 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -77,10 +77,8 @@ */ #if STENCIL_BITS==8 typedef GLubyte GLstencil; -# define STENCIL_MAX 0xff #elif STENCIL_BITS==16 typedef GLushort GLstencil; -# define STENCIL_MAX 0xffff #else # error "illegal number of stencil bits" #endif diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index d8e49cbe415..f0d8bef39c2 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -69,6 +69,7 @@ apply_stencil_op( const GLcontext *ctx, GLenum oper, GLuint face, const GLstencil ref = ctx->Stencil.Ref[face]; const GLstencil wrtmask = ctx->Stencil.WriteMask[face]; const GLstencil invmask = (GLstencil) (~wrtmask); + const GLstencil stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; GLuint i; switch (oper) { @@ -113,7 +114,7 @@ apply_stencil_op( const GLcontext *ctx, GLenum oper, GLuint face, for (i=0;iDrawBuffer; struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; + const GLstencil stencilMax = (1 << fb->Visual.stencilBits) - 1; const GLstencil ref = ctx->Stencil.Ref[face]; const GLstencil wrtmask = ctx->Stencil.WriteMask[face]; const GLstencil invmask = (GLstencil) (~wrtmask); @@ -585,7 +587,7 @@ apply_stencil_op_to_pixels( GLcontext *ctx, for (i=0;i