softpipe: make blend/stencil/depth functions static
authorBrian Paul <brianp@vmware.com>
Sat, 25 Sep 2010 19:58:41 +0000 (13:58 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 25 Sep 2010 20:25:40 +0000 (14:25 -0600)
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_state.h
src/gallium/drivers/softpipe/sp_state_blend.c

index a280879cc4db2b776eb7571e57f4e236a306d1fd..e8daa81d119a3cc9fbb96bd9ceb289f5e5179679 100644 (file)
@@ -228,9 +228,7 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.priv = priv;
 
    /* state setters */
-   softpipe->pipe.create_blend_state = softpipe_create_blend_state;
-   softpipe->pipe.bind_blend_state   = softpipe_bind_blend_state;
-   softpipe->pipe.delete_blend_state = softpipe_delete_blend_state;
+   softpipe_init_blend_funcs(&softpipe->pipe);
 
    softpipe->pipe.create_sampler_state = softpipe_create_sampler_state;
    softpipe->pipe.bind_fragment_sampler_states  = softpipe_bind_sampler_states;
@@ -238,10 +236,6 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.bind_geometry_sampler_states = softpipe_bind_geometry_sampler_states;
    softpipe->pipe.delete_sampler_state = softpipe_delete_sampler_state;
 
-   softpipe->pipe.create_depth_stencil_alpha_state = softpipe_create_depth_stencil_state;
-   softpipe->pipe.bind_depth_stencil_alpha_state   = softpipe_bind_depth_stencil_state;
-   softpipe->pipe.delete_depth_stencil_alpha_state = softpipe_delete_depth_stencil_state;
-
    softpipe->pipe.create_rasterizer_state = softpipe_create_rasterizer_state;
    softpipe->pipe.bind_rasterizer_state   = softpipe_bind_rasterizer_state;
    softpipe->pipe.delete_rasterizer_state = softpipe_delete_rasterizer_state;
@@ -256,10 +250,7 @@ softpipe_create_context( struct pipe_screen *screen,
    softpipe->pipe.bind_stream_output_state = softpipe_bind_stream_output_state;
    softpipe->pipe.delete_stream_output_state = softpipe_delete_stream_output_state;
 
-   softpipe->pipe.set_blend_color = softpipe_set_blend_color;
-   softpipe->pipe.set_stencil_ref = softpipe_set_stencil_ref;
    softpipe->pipe.set_clip_state = softpipe_set_clip_state;
-   softpipe->pipe.set_sample_mask = softpipe_set_sample_mask;
    softpipe->pipe.set_framebuffer_state = softpipe_set_framebuffer_state;
    softpipe->pipe.set_polygon_stipple = softpipe_set_polygon_stipple;
    softpipe->pipe.set_scissor_state = softpipe_set_scissor_state;
index 69243573f7947bfe1c4f81d9119e10d3024ad212..1326f49fe996535287aad1009de9ee7a12034f28 100644 (file)
@@ -115,13 +115,8 @@ struct sp_so_state {
 };
 
 
-void *
-softpipe_create_blend_state(struct pipe_context *,
-                            const struct pipe_blend_state *);
-void softpipe_bind_blend_state(struct pipe_context *,
-                               void *);
-void softpipe_delete_blend_state(struct pipe_context *,
-                                 void *);
+void
+softpipe_init_blend_funcs(struct pipe_context *pipe);
 
 void *
 softpipe_create_sampler_state(struct pipe_context *,
@@ -137,12 +132,6 @@ softpipe_bind_geometry_sampler_states(struct pipe_context *,
                                       void **samplers);
 void softpipe_delete_sampler_state(struct pipe_context *, void *);
 
-void *
-softpipe_create_depth_stencil_state(struct pipe_context *,
-                                    const struct pipe_depth_stencil_alpha_state *);
-void softpipe_bind_depth_stencil_state(struct pipe_context *, void *);
-void softpipe_delete_depth_stencil_state(struct pipe_context *, void *);
-
 void *
 softpipe_create_rasterizer_state(struct pipe_context *,
                                  const struct pipe_rasterizer_state *);
@@ -152,18 +141,9 @@ void softpipe_delete_rasterizer_state(struct pipe_context *, void *);
 void softpipe_set_framebuffer_state( struct pipe_context *,
                                      const struct pipe_framebuffer_state * );
 
-void softpipe_set_blend_color( struct pipe_context *pipe,
-                               const struct pipe_blend_color *blend_color );
-
-void softpipe_set_stencil_ref( struct pipe_context *pipe,
-                               const struct pipe_stencil_ref *stencil_ref );
-
 void softpipe_set_clip_state( struct pipe_context *,
                               const struct pipe_clip_state * );
 
-void softpipe_set_sample_mask( struct pipe_context *,
-                               unsigned sample_mask );
-
 void
 softpipe_init_shader_funcs(struct pipe_context *pipe);
 
index 2a203f44e50de451b4ec26ff3c2954784b6de5b2..12863824b8e4817887eeed5c41c932108a3b621d 100644 (file)
 #include "sp_state.h"
 
 
-void *
+static void *
 softpipe_create_blend_state(struct pipe_context *pipe,
                             const struct pipe_blend_state *blend)
 {
    return mem_dup(blend, sizeof(*blend));
 }
 
-void softpipe_bind_blend_state( struct pipe_context *pipe,
-                                void *blend )
+
+static void
+softpipe_bind_blend_state(struct pipe_context *pipe,
+                          void *blend)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
@@ -53,15 +55,18 @@ void softpipe_bind_blend_state( struct pipe_context *pipe,
    softpipe->dirty |= SP_NEW_BLEND;
 }
 
-void softpipe_delete_blend_state(struct pipe_context *pipe,
-                                 void *blend)
+
+static void
+softpipe_delete_blend_state(struct pipe_context *pipe,
+                            void *blend)
 {
    FREE( blend );
 }
 
 
-void softpipe_set_blend_color( struct pipe_context *pipe,
-                               const struct pipe_blend_color *blend_color )
+static void
+softpipe_set_blend_color(struct pipe_context *pipe,
+                         const struct pipe_blend_color *blend_color)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
@@ -73,19 +78,15 @@ void softpipe_set_blend_color( struct pipe_context *pipe,
 }
 
 
-/** XXX move someday?  Or consolidate all these simple state setters
- * into one file.
- */
-
-
-void *
+static void *
 softpipe_create_depth_stencil_state(struct pipe_context *pipe,
                                     const struct pipe_depth_stencil_alpha_state *depth_stencil)
 {
    return mem_dup(depth_stencil, sizeof(*depth_stencil));
 }
 
-void
+
+static void
 softpipe_bind_depth_stencil_state(struct pipe_context *pipe,
                                   void *depth_stencil)
 {
@@ -96,14 +97,17 @@ softpipe_bind_depth_stencil_state(struct pipe_context *pipe,
    softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
 }
 
-void
+
+static void
 softpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
 {
    FREE( depth );
 }
 
-void softpipe_set_stencil_ref( struct pipe_context *pipe,
-                               const struct pipe_stencil_ref *stencil_ref )
+
+static void
+softpipe_set_stencil_ref(struct pipe_context *pipe,
+                         const struct pipe_stencil_ref *stencil_ref)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
@@ -112,9 +116,28 @@ void softpipe_set_stencil_ref( struct pipe_context *pipe,
    softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
 }
 
-void
+
+static void
 softpipe_set_sample_mask(struct pipe_context *pipe,
                          unsigned sample_mask)
 {
 }
 
+
+void
+softpipe_init_blend_funcs(struct pipe_context *pipe)
+{
+   pipe->create_blend_state = softpipe_create_blend_state;
+   pipe->bind_blend_state   = softpipe_bind_blend_state;
+   pipe->delete_blend_state = softpipe_delete_blend_state;
+
+   pipe->set_blend_color = softpipe_set_blend_color;
+
+   pipe->create_depth_stencil_alpha_state = softpipe_create_depth_stencil_state;
+   pipe->bind_depth_stencil_alpha_state   = softpipe_bind_depth_stencil_state;
+   pipe->delete_depth_stencil_alpha_state = softpipe_delete_depth_stencil_state;
+
+   pipe->set_stencil_ref = softpipe_set_stencil_ref;
+
+   pipe->set_sample_mask = softpipe_set_sample_mask;
+}