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 f7cf06d8d46ad0c9b3be121348f1d072a31844af..ce64bcf18dc5ac18921e90856c7bd91956318e68 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 ed75da8cbe269eb08f6b549e8be7124b900281f6..4fe2db178e2a3fbd84325418cb03e75bc474ca62 100644 (file)
@@ -130,16 +130,6 @@ void llvmpipe_bind_blend_state(struct pipe_context *,
 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 *);
@@ -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 3552ff50ce1b73420eb2996d76d89847ead00e47..55d43368a3e6b4ba06674dbd0063c12b528d8b38 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;
+}