Mesa (master): mesa: Stop clamping stencil reference value at specification time

Chris Forbes chrisf at kemper.freedesktop.org
Wed May 15 10:08:05 UTC 2013


Module: Mesa
Branch: master
Commit: 53a5f11f0d89a044546e2bf4396f1972c9d31c4f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53a5f11f0d89a044546e2bf4396f1972c9d31c4f

Author: Chris Forbes <chrisf at ijw.co.nz>
Date:   Mon May 13 21:54:36 2013 +1200

mesa: Stop clamping stencil reference value at specification time

All drivers now clamp this to the appropriate range for the bound
stencil buffer when emitting stencil state.

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/stencil.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
index cbdee6b..505703a 100644
--- a/src/mesa/main/stencil.c
+++ b/src/mesa/main/stencil.c
@@ -132,7 +132,6 @@ void GLAPIENTRY
 _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask )
 {
    GET_CURRENT_CONTEXT(ctx);
-   const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
 
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glStencilFuncSeparateATI()\n");
@@ -148,8 +147,6 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui
       return;
    }
 
-   ref = CLAMP( ref, 0, stencilMax );
-
    /* set both front and back state */
    if (ctx->Stencil.Function[0] == frontfunc &&
        ctx->Stencil.Function[1] == backfunc &&
@@ -189,7 +186,6 @@ void GLAPIENTRY
 _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
 {
    GET_CURRENT_CONTEXT(ctx);
-   const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
    const GLint face = ctx->Stencil.ActiveFace;
 
    if (MESA_VERBOSE & VERBOSE_API)
@@ -200,8 +196,6 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
       return;
    }
 
-   ref = CLAMP( ref, 0, stencilMax );
-
    if (face != 0) {
       if (ctx->Stencil.Function[face] == func &&
           ctx->Stencil.ValueMask[face] == mask &&
@@ -463,7 +457,6 @@ void GLAPIENTRY
 _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
 {
    GET_CURRENT_CONTEXT(ctx);
-   const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1;
 
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glStencilFuncSeparate()\n");
@@ -477,8 +470,6 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
       return;
    }
 
-   ref = CLAMP(ref, 0, stencilMax);
-
    FLUSH_VERTICES(ctx, _NEW_STENCIL);
 
    if (face != GL_BACK) {




More information about the mesa-commit mailing list