gallium: remove redundant clear_color state.
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 11 Dec 2007 13:19:33 +0000 (13:19 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 11 Dec 2007 13:19:33 +0000 (13:19 +0000)
18 files changed:
src/mesa/pipe/failover/fo_context.h
src/mesa/pipe/failover/fo_state.c
src/mesa/pipe/failover/fo_state_emit.c
src/mesa/pipe/i915simple/i915_context.h
src/mesa/pipe/i915simple/i915_state.c
src/mesa/pipe/i965simple/brw_context.h
src/mesa/pipe/i965simple/brw_state.c
src/mesa/pipe/p_context.h
src/mesa/pipe/p_state.h
src/mesa/pipe/softpipe/sp_context.c
src/mesa/pipe/softpipe/sp_context.h
src/mesa/pipe/softpipe/sp_state.h
src/mesa/pipe/softpipe/sp_state_surface.c
src/mesa/sources
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_atom.h
src/mesa/state_tracker/st_atom_clear_color.c [deleted file]
src/mesa/state_tracker/st_context.h

index 7cf18c9ec19caed9404d8256f4f529476d8e4a12..2423eb4556596a1f0b68588723c2b856bd5f1f84 100644 (file)
@@ -79,7 +79,6 @@ struct failover_context {
    const struct fo_state     *vertex_shader;
 
    struct pipe_blend_color blend_color;
-   struct pipe_clear_color_state clear_color;
    struct pipe_clip_state clip;
    struct pipe_framebuffer_state framebuffer;
    struct pipe_poly_stipple poly_stipple;
index fd6137ba6622912703624697c2a701863868c569..689d2fa3c7937a29f01d1aa2f53b2f82417fe15f 100644 (file)
@@ -146,16 +146,6 @@ failover_set_clip_state( struct pipe_context *pipe,
    failover->hw->set_clip_state( failover->hw, clip );
 }
 
-static void 
-failover_set_clear_color_state( struct pipe_context *pipe,
-                               const struct pipe_clear_color_state *clear_color )
-{
-   struct failover_context *failover = failover_context(pipe);
-
-   failover->clear_color = *clear_color;
-   failover->dirty |= FO_NEW_CLEAR_COLOR;
-   failover->hw->set_clear_color_state( failover->hw, clear_color );
-}
 
 static void *
 failover_create_depth_stencil_state(struct pipe_context *pipe,
@@ -480,7 +470,6 @@ failover_init_state_functions( struct failover_context *failover )
 
    failover->pipe.set_blend_color = failover_set_blend_color;
    failover->pipe.set_clip_state = failover_set_clip_state;
-   failover->pipe.set_clear_color_state = failover_set_clear_color_state;
    failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
    failover->pipe.set_polygon_stipple = failover_set_polygon_stipple;
    failover->pipe.set_sampler_units = failover_set_sampler_units;
index a3aff8abd2a47dc90d80fd317b4374ffa2622a82..612b0a6ca37eb956328783110db348cf0f361763 100644 (file)
@@ -69,9 +69,6 @@ failover_state_emit( struct failover_context *failover )
    if (failover->dirty & FO_NEW_CLIP)
       failover->sw->set_clip_state( failover->sw, &failover->clip );
 
-   if (failover->dirty & FO_NEW_CLEAR_COLOR)
-      failover->sw->set_clear_color_state( failover->sw, &failover->clear_color );
-
    if (failover->dirty & FO_NEW_DEPTH_STENCIL)
       failover->sw->bind_depth_stencil_state( failover->sw,
                                               failover->depth_stencil->sw_state );
index b9b67c4fcfc3da54e4c8d8cf910278c5ff3214b5..a239c8f72e45e1e10b9affb4828787e2422283c9 100644 (file)
@@ -194,7 +194,6 @@ struct i915_context
    const struct pipe_shader_state *fs;
 
    struct pipe_blend_color blend_color;
-   struct pipe_clear_color_state clear_color;
    struct pipe_clip_state clip;
    struct pipe_constant_buffer constants[PIPE_SHADER_TYPES];
    struct pipe_framebuffer_state framebuffer;
index b9f257a0071e212de2f6fa8573310b731058f2ea..a8c6565a54b1f99d6f8f464e723192b0eef7037d 100644 (file)
@@ -548,16 +548,6 @@ static void i915_set_framebuffer_state(struct pipe_context *pipe,
 
 
 
-static void i915_set_clear_color_state(struct pipe_context *pipe,
-                               const struct pipe_clear_color_state *clear)
-{
-   struct i915_context *i915 = i915_context(pipe);
-
-   i915->clear_color = *clear; /* struct copy */
-}
-
-
-
 static void i915_set_clip_state( struct pipe_context *pipe,
                             const struct pipe_clip_state *clip )
 {
@@ -720,7 +710,6 @@ i915_init_state_functions( struct i915_context *i915 )
 
    i915->pipe.set_blend_color = i915_set_blend_color;
    i915->pipe.set_clip_state = i915_set_clip_state;
-   i915->pipe.set_clear_color_state = i915_set_clear_color_state;
    i915->pipe.set_constant_buffer = i915_set_constant_buffer;
    i915->pipe.set_framebuffer_state = i915_set_framebuffer_state;
 
index 00df46e704dca164652b019d0aafdc1912463350..53f66cd6a9d646fcda987a204bcbe3b606fb724a 100644 (file)
@@ -475,7 +475,6 @@ struct brw_context
       struct pipe_scissor_state       Scissor;
       struct pipe_viewport_state      Viewport;
       struct pipe_framebuffer_state   FrameBuffer;
-      struct pipe_clear_color_state   ClearColor;
 
       const struct pipe_constant_buffer *Constants[2];
       const struct brw_texture          *Texture[PIPE_MAX_SAMPLERS];
index b50f23c1a28b0ef8705e13c892e45da49d86b03b..7731c2e01fe164aaff4c4c4b33bc9440c986c3a0 100644 (file)
@@ -377,14 +377,6 @@ static void brw_set_framebuffer_state(struct pipe_context *pipe,
 
 
 
-static void brw_set_clear_color_state(struct pipe_context *pipe,
-                               const struct pipe_clear_color_state *clear)
-{
-   struct brw_context *brw = brw_context(pipe);
-
-   brw->attribs.ClearColor = *clear; /* struct copy */
-}
-
 /************************************************************************
  * Rasterizer state
  */
@@ -449,7 +441,6 @@ brw_init_state_functions( struct brw_context *brw )
 
    brw->pipe.set_blend_color = brw_set_blend_color;
    brw->pipe.set_clip_state = brw_set_clip_state;
-   brw->pipe.set_clear_color_state = brw_set_clear_color_state;
    brw->pipe.set_constant_buffer = brw_set_constant_buffer;
    brw->pipe.set_framebuffer_state = brw_set_framebuffer_state;
 
index 7da4992841f29720ec973c26d0bee59a1a3150d5..6b97844445012b9503b39ad0aa9223e6c5c0a233 100644 (file)
@@ -132,9 +132,6 @@ struct pipe_context {
    void (*set_clip_state)( struct pipe_context *,
                           const struct pipe_clip_state * );
 
-   void (*set_clear_color_state)( struct pipe_context *,
-                                  const struct pipe_clear_color_state * );
-
    void (*set_constant_buffer)( struct pipe_context *,
                                 uint shader, uint index,
                                 const struct pipe_constant_buffer *buf );
index 50344bea78167803c65b871ba526b363ac040b50..56d4f96ed7609de3315e8d7da806630d9ccec42b 100644 (file)
@@ -200,11 +200,6 @@ struct pipe_blend_color {
    float color[4];
 };
 
-struct pipe_clear_color_state
-{
-   float color[4];
-};
-
 struct pipe_framebuffer_state
 {
    /** multiple colorbuffers for multiple render targets */
index 2eab3aaabb9d0ed17b75f93befc2cd60d35b2aa5..43f23dc1e859c3cfe7937a398d6d828902a7a049 100644 (file)
@@ -304,7 +304,6 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
 
    softpipe->pipe.set_blend_color = softpipe_set_blend_color;
    softpipe->pipe.set_clip_state = softpipe_set_clip_state;
-   softpipe->pipe.set_clear_color_state = softpipe_set_clear_color_state;
    softpipe->pipe.set_constant_buffer = softpipe_set_constant_buffer;
    softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
    softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
index 1c391dcd4d3e610737c6420db7d7d5c9bf96ca40..45d15c720e0c4de767c758b228a5bae1ac4a7f1f 100644 (file)
@@ -82,7 +82,6 @@ struct softpipe_context {
    const struct sp_vertex_shader_state *vs;
 
    struct pipe_blend_color blend_color;
-   struct pipe_clear_color_state clear_color;
    struct pipe_clip_state clip;
    struct pipe_constant_buffer constants[2];
    struct pipe_framebuffer_state framebuffer;
index f434567da5d7402b17d4d369055131602ba6bf81..80a1cba25ad8a546cfe02de13c8d64c5ef19577b 100644 (file)
@@ -92,9 +92,6 @@ void softpipe_set_framebuffer_state( struct pipe_context *,
 void softpipe_set_blend_color( struct pipe_context *pipe,
                                const struct pipe_blend_color *blend_color );
 
-void softpipe_set_clear_color_state( struct pipe_context *,
-                                     const struct pipe_clear_color_state * );
-
 void softpipe_set_clip_state( struct pipe_context *,
                             const struct pipe_clip_state * );
 
index 30bedc74bc0286f32754e8dc5fdb0a046bdfca58..ee72aaf4c5a0c860366162dd729750b879f9edce 100644 (file)
@@ -131,11 +131,3 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
 
 
 
-void
-softpipe_set_clear_color_state(struct pipe_context *pipe,
-                               const struct pipe_clear_color_state *clear)
-{
-   struct softpipe_context *softpipe = softpipe_context(pipe);
-
-   softpipe->clear_color = *clear; /* struct copy */
-}
index 4a5a97b47dfe228a8186bbe15cdd1871a0229f5f..fb059498f919457d70565d2dd33c0ef6916b841a 100644 (file)
@@ -200,7 +200,6 @@ STATETRACKER_SOURCES = \
        state_tracker/st_atom.c \
        state_tracker/st_atom_alphatest.c \
        state_tracker/st_atom_blend.c \
-       state_tracker/st_atom_clear_color.c \
        state_tracker/st_atom_clip.c \
        state_tracker/st_atom_constbuf.c \
        state_tracker/st_atom_depth.c \
index 0797ea615e2d5b3420852f068254ac29811008d1..bde81edd8c6d80adec054acc7ba05984497f8627 100644 (file)
@@ -45,7 +45,6 @@
 static const struct st_tracked_state *atoms[] =
 {
    &st_update_framebuffer,
-   &st_update_clear_color,
    &st_update_depth_stencil,
    &st_update_clip,
 
index 3c0db0db095c293ff81d09bd0b2246f70b9ab60a..0114f42ba523f70602b4846cb981bc2c4974b8ca 100644 (file)
@@ -46,7 +46,6 @@ void st_validate_state( struct st_context *st );
 
 const struct st_tracked_state st_update_framebuffer;
 const struct st_tracked_state st_update_clip;
-const struct st_tracked_state st_update_clear_color;
 const struct st_tracked_state st_update_depth_stencil;
 const struct st_tracked_state st_update_shader;
 const struct st_tracked_state st_update_rasterizer;
diff --git a/src/mesa/state_tracker/st_atom_clear_color.c b/src/mesa/state_tracker/st_atom_clear_color.c
deleted file mode 100644 (file)
index ce3431c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
- **************************************************************************/
-
- /*
-  * Authors:
-  *   Keith Whitwell <keith@tungstengraphics.com>
-  *   Brian Paul
-  */
-#include "st_context.h"
-#include "st_atom.h"
-#include "pipe/p_context.h"
-
-
-static void
-update_clear_color_state( struct st_context *st )
-{
-   struct pipe_clear_color_state clear;
-
-   clear.color[0] = st->ctx->Color.ClearColor[0];
-   clear.color[1] = st->ctx->Color.ClearColor[1];
-   clear.color[2] = st->ctx->Color.ClearColor[2];
-   clear.color[3] = st->ctx->Color.ClearColor[3];
-
-   if (memcmp(&clear, &st->state.clear_color, sizeof(clear)) != 0) {
-      st->state.clear_color = clear;
-      st->pipe->set_clear_color_state( st->pipe, &clear );
-   }
-}
-
-
-const struct st_tracked_state st_update_clear_color = {
-   .name = "st_update_clear_color",
-   .dirty = {
-      .mesa = _NEW_COLOR,
-      .st  = 0,
-   },
-   .update = update_clear_color_state
-};
index 33aacdb6d1a1060fbb5a8e1e4c83eae7af843f72..4855961d0997b12338a1a4ea7df8284cd41ce215 100644 (file)
@@ -103,7 +103,6 @@ struct st_context
       const struct cso_vertex_shader   *vs;
 
       struct pipe_blend_color  blend_color;
-      struct pipe_clear_color_state clear_color;
       struct pipe_clip_state clip;
       struct pipe_constant_buffer constants[2];
       struct pipe_framebuffer_state framebuffer;