llvmpipe: make shader-related functions static, clean-up initializations
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 20:13:11 +0000 (14:13 -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_fs.c
src/gallium/drivers/llvmpipe/lp_state_vs.c

index a5d8c9167cbedac5afeb146d1f579d66ed10c2c1..8159daaae680430db7ca5156d14f2676a0eb397b 100644 (file)
@@ -104,15 +104,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe->pipe.bind_rasterizer_state   = llvmpipe_bind_rasterizer_state;
    llvmpipe->pipe.delete_rasterizer_state = llvmpipe_delete_rasterizer_state;
 
-   llvmpipe->pipe.create_fs_state = llvmpipe_create_fs_state;
-   llvmpipe->pipe.bind_fs_state   = llvmpipe_bind_fs_state;
-   llvmpipe->pipe.delete_fs_state = llvmpipe_delete_fs_state;
-
-   llvmpipe->pipe.create_vs_state = llvmpipe_create_vs_state;
-   llvmpipe->pipe.bind_vs_state   = llvmpipe_bind_vs_state;
-   llvmpipe->pipe.delete_vs_state = llvmpipe_delete_vs_state;
-
-   llvmpipe->pipe.set_constant_buffer = llvmpipe_set_constant_buffer;
    llvmpipe->pipe.set_framebuffer_state = llvmpipe_set_framebuffer_state;
 
    llvmpipe->pipe.clear = llvmpipe_clear;
@@ -124,6 +115,8 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
    llvmpipe_init_sampler_funcs(llvmpipe);
    llvmpipe_init_query_funcs( llvmpipe );
    llvmpipe_init_vertex_funcs(llvmpipe);
+   llvmpipe_init_fs_funcs(llvmpipe);
+   llvmpipe_init_vs_funcs(llvmpipe);
    llvmpipe_init_context_resource_funcs( &llvmpipe->pipe );
 
    /*
index ce7ea41dca1298a705e0a9a1b591a39fd95551ca..4493c238a2d8c9adf8276a970bfd992e39c69b52 100644 (file)
@@ -131,19 +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_constant_buffer(struct pipe_context *,
-                                  uint shader, uint index,
-                                  struct pipe_resource *buf);
-
-void *llvmpipe_create_fs_state(struct pipe_context *,
-                               const struct pipe_shader_state *);
-void llvmpipe_bind_fs_state(struct pipe_context *, void *);
-void llvmpipe_delete_fs_state(struct pipe_context *, void *);
-void *llvmpipe_create_vs_state(struct pipe_context *,
-                               const struct pipe_shader_state *);
-void llvmpipe_bind_vs_state(struct pipe_context *, void *);
-void llvmpipe_delete_vs_state(struct pipe_context *, void *);
-
 void llvmpipe_update_fs(struct llvmpipe_context *lp);
 
 void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe );
@@ -171,5 +158,11 @@ llvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe);
 void
 llvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe);
 
+void
+llvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe);
+
+void
+llvmpipe_init_vs_funcs(struct llvmpipe_context *llvmpipe);
+
 
 #endif
index adb26f7508a9dcd425af2caf708021d9ad91b507..965777b641171a0ca4fca36961ed395bfceaf951 100644 (file)
@@ -950,7 +950,7 @@ generate_variant(struct llvmpipe_context *lp,
 }
 
 
-void *
+static void *
 llvmpipe_create_fs_state(struct pipe_context *pipe,
                          const struct pipe_shader_state *templ)
 {
@@ -975,7 +975,7 @@ llvmpipe_create_fs_state(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
@@ -991,7 +991,7 @@ llvmpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
 }
 
 
-void
+static void
 llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
@@ -1034,7 +1034,7 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
 
 
 
-void
+static void
 llvmpipe_set_constant_buffer(struct pipe_context *pipe,
                              uint shader, uint index,
                              struct pipe_resource *constants)
@@ -1182,3 +1182,15 @@ llvmpipe_update_fs(struct llvmpipe_context *lp)
                              variant->jit_function[RAST_EDGE_TEST],
                              opaque);
 }
+
+
+
+void
+llvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe)
+{
+   llvmpipe->pipe.create_fs_state = llvmpipe_create_fs_state;
+   llvmpipe->pipe.bind_fs_state   = llvmpipe_bind_fs_state;
+   llvmpipe->pipe.delete_fs_state = llvmpipe_delete_fs_state;
+
+   llvmpipe->pipe.set_constant_buffer = llvmpipe_set_constant_buffer;
+}
index 118feccc8e9eb25ef8b68a78053268cafc189f95..f2d880899060ad31abcd7a71fa1776a1cfefc8ad 100644 (file)
@@ -38,7 +38,7 @@
 #include "lp_state.h"
 
 
-void *
+static void *
 llvmpipe_create_vs_state(struct pipe_context *pipe,
                          const struct pipe_shader_state *templ)
 {
@@ -76,7 +76,7 @@ fail:
 }
 
 
-void
+static void
 llvmpipe_bind_vs_state(struct pipe_context *pipe, void *_vs)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
@@ -94,7 +94,7 @@ llvmpipe_bind_vs_state(struct pipe_context *pipe, void *_vs)
 }
 
 
-void
+static void
 llvmpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
 {
    struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
@@ -106,3 +106,13 @@ llvmpipe_delete_vs_state(struct pipe_context *pipe, void *vs)
    FREE( (void *)state->shader.tokens );
    FREE( state );
 }
+
+
+
+void
+llvmpipe_init_vs_funcs(struct llvmpipe_context *llvmpipe)
+{
+   llvmpipe->pipe.create_vs_state = llvmpipe_create_vs_state;
+   llvmpipe->pipe.bind_vs_state   = llvmpipe_bind_vs_state;
+   llvmpipe->pipe.delete_vs_state = llvmpipe_delete_vs_state;
+}