softpipe: make vertex state functions static
authorBrian Paul <brianp@vmware.com>
Sat, 25 Sep 2010 20:06:58 +0000 (14:06 -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_vertex.c

index e7b6fc445d95723e9e8030a38910fef3457c11d5..ad8975a59d3dc02ac029616d2291c3df18843b56 100644 (file)
@@ -237,9 +237,7 @@ softpipe_create_context( struct pipe_screen *screen,
 
    softpipe_init_shader_funcs(&softpipe->pipe);
 
-   softpipe->pipe.create_vertex_elements_state = softpipe_create_vertex_elements_state;
-   softpipe->pipe.bind_vertex_elements_state = softpipe_bind_vertex_elements_state;
-   softpipe->pipe.delete_vertex_elements_state = softpipe_delete_vertex_elements_state;
+   softpipe_init_vertex_funcs(&softpipe->pipe);
 
    softpipe->pipe.create_stream_output_state = softpipe_create_stream_output_state;
    softpipe->pipe.bind_stream_output_state = softpipe_bind_stream_output_state;
@@ -252,8 +250,6 @@ softpipe_create_context( struct pipe_screen *screen,
 
    softpipe->pipe.set_viewport_state = softpipe_set_viewport_state;
    softpipe->pipe.set_stream_output_buffers = softpipe_set_stream_output_buffers;
-   softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers;
-   softpipe->pipe.set_index_buffer = softpipe_set_index_buffer;
 
    softpipe->pipe.draw_vbo = softpipe_draw_vbo;
    softpipe->pipe.draw_stream_output = softpipe_draw_stream_output;
index 8d4efb1c6612b5649d9552e81d43c66c68b57c7a..62a9aaa46a84aee1fe17391993ec62866a43b0b1 100644 (file)
@@ -137,11 +137,8 @@ void softpipe_set_clip_state( struct pipe_context *,
 void
 softpipe_init_shader_funcs(struct pipe_context *pipe);
 
-void *softpipe_create_vertex_elements_state(struct pipe_context *,
-                                            unsigned count,
-                                            const struct pipe_vertex_element *);
-void softpipe_bind_vertex_elements_state(struct pipe_context *, void *);
-void softpipe_delete_vertex_elements_state(struct pipe_context *, void *);
+void
+softpipe_init_vertex_funcs(struct pipe_context *pipe);
 
 void softpipe_set_polygon_stipple( struct pipe_context *,
                                    const struct pipe_poly_stipple * );
@@ -153,13 +150,6 @@ void softpipe_set_scissor_state( struct pipe_context *,
 void softpipe_set_viewport_state( struct pipe_context *,
                                   const struct pipe_viewport_state * );
 
-void softpipe_set_vertex_buffers(struct pipe_context *,
-                                 unsigned count,
-                                 const struct pipe_vertex_buffer *);
-
-void softpipe_set_index_buffer(struct pipe_context *,
-                               const struct pipe_index_buffer *);
-
 
 void softpipe_update_derived( struct softpipe_context *softpipe );
 
index b650fcaea5cb55797542c93e355873252af34169..7d8055f2bafd6ecc8984817be949fb3cb4eb8d1d 100644 (file)
@@ -36,7 +36,7 @@
 #include "draw/draw_context.h"
 
 
-void *
+static void *
 softpipe_create_vertex_elements_state(struct pipe_context *pipe,
                                       unsigned count,
                                       const struct pipe_vertex_element *attribs)
@@ -51,7 +51,8 @@ softpipe_create_vertex_elements_state(struct pipe_context *pipe,
    return velems;
 }
 
-void
+
+static void
 softpipe_bind_vertex_elements_state(struct pipe_context *pipe,
                                     void *velems)
 {
@@ -66,13 +67,15 @@ softpipe_bind_vertex_elements_state(struct pipe_context *pipe,
       draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem);
 }
 
-void
+
+static void
 softpipe_delete_vertex_elements_state(struct pipe_context *pipe, void *velems)
 {
    FREE( velems );
 }
 
-void
+
+static void
 softpipe_set_vertex_buffers(struct pipe_context *pipe,
                             unsigned count,
                             const struct pipe_vertex_buffer *buffers)
@@ -89,7 +92,8 @@ softpipe_set_vertex_buffers(struct pipe_context *pipe,
    draw_set_vertex_buffers(softpipe->draw, count, buffers);
 }
 
-void
+
+static void
 softpipe_set_index_buffer(struct pipe_context *pipe,
                           const struct pipe_index_buffer *ib)
 {
@@ -102,3 +106,15 @@ softpipe_set_index_buffer(struct pipe_context *pipe,
 
    draw_set_index_buffer(softpipe->draw, ib);
 }
+
+
+void
+softpipe_init_vertex_funcs(struct pipe_context *pipe)
+{
+   pipe->create_vertex_elements_state = softpipe_create_vertex_elements_state;
+   pipe->bind_vertex_elements_state = softpipe_bind_vertex_elements_state;
+   pipe->delete_vertex_elements_state = softpipe_delete_vertex_elements_state;
+
+   pipe->set_vertex_buffers = softpipe_set_vertex_buffers;
+   pipe->set_index_buffer = softpipe_set_index_buffer;
+}