llvmpipe: make sampler-related functions static, clean-up initializations
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 19:57:03 +0000 (13:57 -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_sampler.c

index f7cf06d..ce64bcf 100644 (file)
@@ -104,11 +104,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.bind_blend_state   = llvmpipe_bind_blend_state;
    llvmpipe->pipe.delete_blend_state = llvmpipe_delete_blend_state;
 
-   llvmpipe->pipe.create_sampler_state = llvmpipe_create_sampler_state;
-   llvmpipe->pipe.bind_fragment_sampler_states  = llvmpipe_bind_sampler_states;
-   llvmpipe->pipe.bind_vertex_sampler_states  = llvmpipe_bind_vertex_sampler_states;
-   llvmpipe->pipe.delete_sampler_state = llvmpipe_delete_sampler_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;
@@ -136,10 +131,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.set_framebuffer_state = llvmpipe_set_framebuffer_state;
    llvmpipe->pipe.set_polygon_stipple = llvmpipe_set_polygon_stipple;
    llvmpipe->pipe.set_scissor_state = llvmpipe_set_scissor_state;
-   llvmpipe->pipe.set_fragment_sampler_views = llvmpipe_set_fragment_sampler_views;
-   llvmpipe->pipe.set_vertex_sampler_views = llvmpipe_set_vertex_sampler_views;
-   llvmpipe->pipe.create_sampler_view = llvmpipe_create_sampler_view;
-   llvmpipe->pipe.sampler_view_destroy = llvmpipe_sampler_view_destroy;
+
    llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state;
 
    llvmpipe->pipe.set_vertex_buffers = llvmpipe_set_vertex_buffers;
@@ -152,6 +144,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.flush = llvmpipe_flush;
 
 
+   llvmpipe_init_sampler_funcs(llvmpipe);
    llvmpipe_init_query_funcs( llvmpipe );
    llvmpipe_init_context_resource_funcs( &llvmpipe->pipe );
 
index ed75da8..4fe2db1 100644 (file)
@@ -131,16 +131,6 @@ void llvmpipe_delete_blend_state(struct pipe_context *,
                                  void *);
 
 void *
-llvmpipe_create_sampler_state(struct pipe_context *,
-                              const struct pipe_sampler_state *);
-void llvmpipe_bind_sampler_states(struct pipe_context *, unsigned, void **);
-void
-llvmpipe_bind_vertex_sampler_states(struct pipe_context *,
-                                    unsigned num_samplers,
-                                    void **samplers);
-void llvmpipe_delete_sampler_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 *);
@@ -189,24 +179,6 @@ void llvmpipe_set_polygon_stipple( struct pipe_context *,
 void llvmpipe_set_scissor_state( struct pipe_context *,
                                  const struct pipe_scissor_state * );
 
-void llvmpipe_set_fragment_sampler_views(struct pipe_context *,
-                                         unsigned num,
-                                         struct pipe_sampler_view **);
-
-void
-llvmpipe_set_vertex_sampler_views(struct pipe_context *,
-                                  unsigned num,
-                                  struct pipe_sampler_view **);
-
-struct pipe_sampler_view *
-llvmpipe_create_sampler_view(struct pipe_context *pipe,
-                            struct pipe_resource *texture,
-                            const struct pipe_sampler_view *templ);
-
-void
-llvmpipe_sampler_view_destroy(struct pipe_context *pipe,
-                              struct pipe_sampler_view *view);
-
 void llvmpipe_set_viewport_state( struct pipe_context *,
                                   const struct pipe_viewport_state * );
 
@@ -241,4 +213,8 @@ void
 llvmpipe_unmap_texture_surfaces(struct llvmpipe_context *lp);
 
 
+void
+llvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe);
+
+
 #endif
index 3552ff5..55d4336 100644 (file)
@@ -41,7 +41,7 @@
 
 
 
-void *
+static void *
 llvmpipe_create_sampler_state(struct pipe_context *pipe,
                               const struct pipe_sampler_state *sampler)
 {
@@ -49,7 +49,7 @@ llvmpipe_create_sampler_state(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_bind_sampler_states(struct pipe_context *pipe,
                              unsigned num, void **sampler)
 {
@@ -76,7 +76,7 @@ llvmpipe_bind_sampler_states(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_bind_vertex_sampler_states(struct pipe_context *pipe,
                                     unsigned num_samplers,
                                     void **samplers)
@@ -104,7 +104,7 @@ llvmpipe_bind_vertex_sampler_states(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_set_fragment_sampler_views(struct pipe_context *pipe,
                                     unsigned num,
                                     struct pipe_sampler_view **views)
@@ -133,7 +133,7 @@ llvmpipe_set_fragment_sampler_views(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_set_vertex_sampler_views(struct pipe_context *pipe,
                                   unsigned num,
                                   struct pipe_sampler_view **views)
@@ -163,7 +163,7 @@ llvmpipe_set_vertex_sampler_views(struct pipe_context *pipe,
 }
 
 
-struct pipe_sampler_view *
+static struct pipe_sampler_view *
 llvmpipe_create_sampler_view(struct pipe_context *pipe,
                             struct pipe_resource *texture,
                             const struct pipe_sampler_view *templ)
@@ -182,7 +182,7 @@ llvmpipe_create_sampler_view(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_sampler_view_destroy(struct pipe_context *pipe,
                               struct pipe_sampler_view *view)
 {
@@ -191,7 +191,7 @@ llvmpipe_sampler_view_destroy(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_delete_sampler_state(struct pipe_context *pipe,
                               void *sampler)
 {
@@ -199,4 +199,16 @@ llvmpipe_delete_sampler_state(struct pipe_context *pipe,
 }
 
 
-
+void
+llvmpipe_init_sampler_funcs(struct llvmpipe_context *llvmpipe)
+{
+   llvmpipe->pipe.create_sampler_state = llvmpipe_create_sampler_state;
+
+   llvmpipe->pipe.bind_fragment_sampler_states  = llvmpipe_bind_sampler_states;
+   llvmpipe->pipe.bind_vertex_sampler_states  = llvmpipe_bind_vertex_sampler_states;
+   llvmpipe->pipe.set_fragment_sampler_views = llvmpipe_set_fragment_sampler_views;
+   llvmpipe->pipe.set_vertex_sampler_views = llvmpipe_set_vertex_sampler_views;
+   llvmpipe->pipe.create_sampler_view = llvmpipe_create_sampler_view;
+   llvmpipe->pipe.sampler_view_destroy = llvmpipe_sampler_view_destroy;
+   llvmpipe->pipe.delete_sampler_state = llvmpipe_delete_sampler_state;
+}