radeon/r200: remove ClearDepth() and ClearStencil() driver hooks
authorBrian Paul <brianp@vmware.com>
Mon, 12 Mar 2012 00:31:32 +0000 (18:31 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 12 Mar 2012 17:40:43 +0000 (11:40 -0600)
The computed stencil.clear and depth.clear values aren't used anywhere.
Those fields have been removed too.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r200/r200_state_init.c
src/mesa/drivers/dri/radeon/radeon_common_context.h
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/drivers/dri/radeon/radeon_state_init.c

index 5677a9e7b8fa48650551abbcb5934dd16ef8a965..1c32571cbc18d63915e9bb3094e9507d0d7325de 100644 (file)
@@ -354,22 +354,6 @@ static void r200DepthFunc( struct gl_context *ctx, GLenum func )
    }
 }
 
-static void r200ClearDepth( struct gl_context *ctx, GLclampd d )
-{
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-   GLuint format = (rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &
-                   R200_DEPTH_FORMAT_MASK);
-
-   switch ( format ) {
-   case R200_DEPTH_FORMAT_16BIT_INT_Z:
-      rmesa->radeon.state.depth.clear = d * 0x0000ffff;
-      break;
-   case R200_DEPTH_FORMAT_24BIT_INT_Z:
-      rmesa->radeon.state.depth.clear = d * 0x00ffffff;
-      break;
-   }
-}
-
 static void r200DepthMask( struct gl_context *ctx, GLboolean flag )
 {
    r200ContextPtr rmesa = R200_CONTEXT(ctx);
@@ -1547,16 +1531,6 @@ r200StencilOpSeparate( struct gl_context *ctx, GLenum face, GLenum fail,
    }
 }
 
-static void r200ClearStencil( struct gl_context *ctx, GLint s )
-{
-   r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
-   rmesa->radeon.state.stencil.clear =
-      ((GLuint) (ctx->Stencil.Clear & 0xff) |
-       (0xff << R200_STENCIL_MASK_SHIFT) |
-       ((ctx->Stencil.WriteMask[0] & 0xff) << R200_STENCIL_WRITEMASK_SHIFT));
-}
-
 
 /* =============================================================
  * Window position and viewport transformation
@@ -2479,8 +2453,6 @@ void r200InitStateFuncs( radeonContextPtr radeon, struct dd_function_table *func
    functions->BlendEquationSeparate    = r200BlendEquationSeparate;
    functions->BlendFuncSeparate                = r200BlendFuncSeparate;
    functions->ClearColor               = r200ClearColor;
-   functions->ClearDepth               = r200ClearDepth;
-   functions->ClearStencil             = r200ClearStencil;
    functions->ClipPlane                        = r200ClipPlane;
    functions->ColorMask                        = r200ColorMask;
    functions->CullFace                 = r200CullFace;
index bddecaf2c2d13eebc99e63468fba100b6e24be00..138100926cf59fdbb529cd11627aa154cdb4438f 100644 (file)
@@ -622,18 +622,6 @@ void r200InitState( r200ContextPtr rmesa )
 
    rmesa->radeon.state.color.clear = 0x00000000;
 
-   switch ( ctx->Visual.depthBits ) {
-   case 16:
-      rmesa->radeon.state.depth.clear = 0x0000ffff;
-      rmesa->radeon.state.stencil.clear = 0x00000000;
-      break;
-   case 24:
-   default:
-      rmesa->radeon.state.depth.clear = 0x00ffffff;
-      rmesa->radeon.state.stencil.clear = 0xffff0000;
-      break;
-   }
-
    rmesa->radeon.Fallback = 0;
 
    rmesa->radeon.hw.max_state_size = 0;
index 80ae2d1e380e22c8c76d6c266bc582f9df9093ac..fdffb1ec04e3f3152a5579bf37ad69c85d54f612 100644 (file)
@@ -117,7 +117,6 @@ struct radeon_colorbuffer_state {
 };
 
 struct radeon_depthbuffer_state {
-       GLuint clear;
        struct gl_renderbuffer *rb;
 };
 
@@ -130,10 +129,6 @@ struct radeon_scissor_state {
        drm_clip_rect_t *pClipRects;
 };
 
-struct radeon_stencilbuffer_state {
-       GLuint clear;           /* rb3d_stencilrefmask value */
-};
-
 struct radeon_state_atom {
        struct radeon_state_atom *next, *prev;
        const char *name;       /* for debug */
@@ -377,7 +372,6 @@ struct radeon_state {
        struct radeon_colorbuffer_state color;
        struct radeon_depthbuffer_state depth;
        struct radeon_scissor_state scissor;
-       struct radeon_stencilbuffer_state stencil;
 };
 
 /**
index a207940e526ddae10343aae83e146b7c133f4263..dcec8138594c7346d361b82c04cb0076fdedd640 100644 (file)
@@ -305,22 +305,6 @@ static void radeonDepthMask( struct gl_context *ctx, GLboolean flag )
    }
 }
 
-static void radeonClearDepth( struct gl_context *ctx, GLclampd d )
-{
-   r100ContextPtr rmesa = R100_CONTEXT(ctx);
-   GLuint format = (rmesa->hw.ctx.cmd[CTX_RB3D_ZSTENCILCNTL] &
-                   RADEON_DEPTH_FORMAT_MASK);
-
-   switch ( format ) {
-   case RADEON_DEPTH_FORMAT_16BIT_INT_Z:
-      rmesa->radeon.state.depth.clear = d * 0x0000ffff;
-      break;
-   case RADEON_DEPTH_FORMAT_24BIT_INT_Z:
-      rmesa->radeon.state.depth.clear = d * 0x00ffffff;
-      break;
-   }
-}
-
 
 /* =============================================================
  * Fog
@@ -1346,15 +1330,6 @@ static void radeonStencilOpSeparate( struct gl_context *ctx, GLenum face, GLenum
    }
 }
 
-static void radeonClearStencil( struct gl_context *ctx, GLint s )
-{
-   r100ContextPtr rmesa = R100_CONTEXT(ctx);
-
-   rmesa->radeon.state.stencil.clear =
-      ((GLuint) (ctx->Stencil.Clear & 0xff) |
-       (0xff << RADEON_STENCIL_MASK_SHIFT) |
-       ((ctx->Stencil.WriteMask[0] & 0xff) << RADEON_STENCIL_WRITEMASK_SHIFT));
-}
 
 
 /* =============================================================
@@ -2234,8 +2209,6 @@ void radeonInitStateFuncs( struct gl_context *ctx )
    ctx->Driver.BlendEquationSeparate   = radeonBlendEquationSeparate;
    ctx->Driver.BlendFuncSeparate       = radeonBlendFuncSeparate;
    ctx->Driver.ClearColor              = radeonClearColor;
-   ctx->Driver.ClearDepth              = radeonClearDepth;
-   ctx->Driver.ClearStencil            = radeonClearStencil;
    ctx->Driver.ClipPlane               = radeonClipPlane;
    ctx->Driver.ColorMask               = radeonColorMask;
    ctx->Driver.CullFace                        = radeonCullFace;
index 151f4f5145ad2e82ca6a335877c38a082b7035e6..1f445b27e3b6d029a19d8161e6a0540a78f27115 100644 (file)
@@ -508,19 +508,6 @@ void radeonInitState( r100ContextPtr rmesa )
 
    rmesa->radeon.state.color.clear = 0x00000000;
 
-   switch ( ctx->Visual.depthBits ) {
-   case 16:
-      rmesa->radeon.state.depth.clear = 0x0000ffff;
-      rmesa->radeon.state.stencil.clear = 0x00000000;
-      break;
-   case 24:
-      rmesa->radeon.state.depth.clear = 0x00ffffff;
-      rmesa->radeon.state.stencil.clear = 0xffff0000;
-      break;
-   default:
-      break;
-   }
-
    rmesa->radeon.Fallback = 0;