llvmpipe: make blend-related functions static, clean-up initializations
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 20:01:04 +0000 (14:01 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 21:25:50 +0000 (15:25 -0600)
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_state.h
src/gallium/drivers/llvmpipe/lp_state_blend.c

index ce64bcf18dc5ac18921e90856c7bd91956318e68..53a32b71a00b482d4a2388fd2834d9a3c36edb22 100644 (file)
@@ -100,14 +100,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.destroy = llvmpipe_destroy;
 
    /* state setters */
-   llvmpipe->pipe.create_blend_state = llvmpipe_create_blend_state;
-   llvmpipe->pipe.bind_blend_state   = llvmpipe_bind_blend_state;
-   llvmpipe->pipe.delete_blend_state = llvmpipe_delete_blend_state;
-
-   llvmpipe->pipe.create_depth_stencil_alpha_state = llvmpipe_create_depth_stencil_state;
-   llvmpipe->pipe.bind_depth_stencil_alpha_state   = llvmpipe_bind_depth_stencil_state;
-   llvmpipe->pipe.delete_depth_stencil_alpha_state = llvmpipe_delete_depth_stencil_state;
-
    llvmpipe->pipe.create_rasterizer_state = llvmpipe_create_rasterizer_state;
    llvmpipe->pipe.bind_rasterizer_state   = llvmpipe_bind_rasterizer_state;
    llvmpipe->pipe.delete_rasterizer_state = llvmpipe_delete_rasterizer_state;
@@ -124,8 +116,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.bind_vertex_elements_state = llvmpipe_bind_vertex_elements_state;
    llvmpipe->pipe.delete_vertex_elements_state = llvmpipe_delete_vertex_elements_state;
 
-   llvmpipe->pipe.set_blend_color = llvmpipe_set_blend_color;
-   llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref;
    llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state;
    llvmpipe->pipe.set_constant_buffer = llvmpipe_set_constant_buffer;
    llvmpipe->pipe.set_framebuffer_state = llvmpipe_set_framebuffer_state;
@@ -144,6 +134,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.flush = llvmpipe_flush;
 
 
+   llvmpipe_init_blend_funcs(llvmpipe);
    llvmpipe_init_sampler_funcs(llvmpipe);
    llvmpipe_init_query_funcs( llvmpipe );
    llvmpipe_init_context_resource_funcs( &llvmpipe->pipe );
index 4fe2db178e2a3fbd84325418cb03e75bc474ca62..a2f6b17334c8d8df469a96f770021c3b34642261 100644 (file)
@@ -122,20 +122,6 @@ struct lp_velems_state {
 };
 
 
-void *
-llvmpipe_create_blend_state(struct pipe_context *,
-                            const struct pipe_blend_state *);
-void llvmpipe_bind_blend_state(struct pipe_context *,
-                               void *);
-void llvmpipe_delete_blend_state(struct pipe_context *,
-                                 void *);
-
-void *
-llvmpipe_create_depth_stencil_state(struct pipe_context *,
-                                    const struct pipe_depth_stencil_alpha_state *);
-void llvmpipe_bind_depth_stencil_state(struct pipe_context *, void *);
-void llvmpipe_delete_depth_stencil_state(struct pipe_context *, void *);
-
 void *
 llvmpipe_create_rasterizer_state(struct pipe_context *,
                                  const struct pipe_rasterizer_state *);
@@ -145,12 +131,6 @@ void llvmpipe_delete_rasterizer_state(struct pipe_context *, void *);
 void llvmpipe_set_framebuffer_state( struct pipe_context *,
                                      const struct pipe_framebuffer_state * );
 
-void llvmpipe_set_blend_color( struct pipe_context *pipe,
-                               const struct pipe_blend_color *blend_color );
-
-void llvmpipe_set_stencil_ref( struct pipe_context *pipe,
-                               const struct pipe_stencil_ref *stencil_ref );
-
 void llvmpipe_set_clip_state( struct pipe_context *,
                               const struct pipe_clip_state * );
 
@@ -216,5 +196,8 @@ llvmpipe_unmap_texture_surfaces(struct llvmpipe_context *lp);
 void
 llvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe);
 
+void
+llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe);
+
 
 #endif
index 4ee28473e8069fcd5c401dbc93aedc4ee20e2d20..8569507f4e5e94c4860e654e91587dd82061b938 100644 (file)
 #include "lp_state.h"
 
 
-void *
+static void *
 llvmpipe_create_blend_state(struct pipe_context *pipe,
                             const struct pipe_blend_state *blend)
 {
    return mem_dup(blend, sizeof(*blend));
 }
 
-void llvmpipe_bind_blend_state( struct pipe_context *pipe,
-                                void *blend )
+
+static void
+llvmpipe_bind_blend_state(struct pipe_context *pipe, void *blend)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
 
@@ -62,15 +63,17 @@ void llvmpipe_bind_blend_state( struct pipe_context *pipe,
    llvmpipe->dirty |= LP_NEW_BLEND;
 }
 
-void llvmpipe_delete_blend_state(struct pipe_context *pipe,
-                                 void *blend)
+
+static void
+llvmpipe_delete_blend_state(struct pipe_context *pipe, void *blend)
 {
    FREE( blend );
 }
 
 
-void llvmpipe_set_blend_color( struct pipe_context *pipe,
-                            const struct pipe_blend_color *blend_color )
+static void
+llvmpipe_set_blend_color(struct pipe_context *pipe,
+                         const struct pipe_blend_color *blend_color)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
 
@@ -93,14 +96,15 @@ void llvmpipe_set_blend_color( struct pipe_context *pipe,
  */
 
 
-void *
+static void *
 llvmpipe_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
 llvmpipe_bind_depth_stencil_state(struct pipe_context *pipe,
                                   void *depth_stencil)
 {
@@ -116,14 +120,17 @@ llvmpipe_bind_depth_stencil_state(struct pipe_context *pipe,
    llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA;
 }
 
-void
+
+static void
 llvmpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth)
 {
    FREE( depth );
 }
 
-void llvmpipe_set_stencil_ref( struct pipe_context *pipe,
-                               const struct pipe_stencil_ref *stencil_ref )
+
+static void
+llvmpipe_set_stencil_ref(struct pipe_context *pipe,
+                         const struct pipe_stencil_ref *stencil_ref)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
 
@@ -142,3 +149,18 @@ void llvmpipe_set_stencil_ref( struct pipe_context *pipe,
 }
 
 
+void
+llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe)
+{
+   llvmpipe->pipe.create_blend_state = llvmpipe_create_blend_state;
+   llvmpipe->pipe.bind_blend_state   = llvmpipe_bind_blend_state;
+   llvmpipe->pipe.delete_blend_state = llvmpipe_delete_blend_state;
+
+   llvmpipe->pipe.create_depth_stencil_alpha_state = llvmpipe_create_depth_stencil_state;
+   llvmpipe->pipe.bind_depth_stencil_alpha_state   = llvmpipe_bind_depth_stencil_state;
+   llvmpipe->pipe.delete_depth_stencil_alpha_state = llvmpipe_delete_depth_stencil_state;
+
+   llvmpipe->pipe.set_blend_color = llvmpipe_set_blend_color;
+
+   llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref;
+}