llvmpipe: make draw-related functions static, clean-up initializations
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 20:06:23 +0000 (14:06 -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_draw_arrays.c
src/gallium/drivers/llvmpipe/lp_state.h

index 52906e280c4955a65198265dfd252ad30070ce4b..73d2ac0bf611a717b20a82a1d69c0119c89bae2a 100644 (file)
@@ -120,14 +120,11 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
 
    llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state;
 
-   llvmpipe->pipe.draw_arrays = llvmpipe_draw_arrays;
-   llvmpipe->pipe.draw_elements = llvmpipe_draw_elements;
-   llvmpipe->pipe.draw_range_elements = llvmpipe_draw_range_elements;
-
    llvmpipe->pipe.clear = llvmpipe_clear;
    llvmpipe->pipe.flush = llvmpipe_flush;
 
    llvmpipe_init_blend_funcs(llvmpipe);
+   llvmpipe_init_draw_funcs(llvmpipe);
    llvmpipe_init_sampler_funcs(llvmpipe);
    llvmpipe_init_query_funcs( llvmpipe );
    llvmpipe_init_vertex_funcs(llvmpipe);
index 0b63e1c889e967d3f774a1f739f1c9a6302e08a3..98780d7631b466e9d250219dcb1aadd7ea4e84d5 100644 (file)
 
 
 
-void
-llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
-                     unsigned start, unsigned count)
-{
-   llvmpipe_draw_elements(pipe, NULL, 0, 0, mode, start, count);
-}
-
-
 /**
  * Draw vertex arrays, with optional indexing.
  * Basically, map the vertex buffers (and drawing surfaces), then hand off
  * the drawing to the 'draw' module.
  */
-void
+static void
 llvmpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_resource *indexBuffer,
                              unsigned indexSize,
@@ -115,7 +107,7 @@ llvmpipe_draw_range_elements(struct pipe_context *pipe,
 }
 
 
-void
+static void
 llvmpipe_draw_elements(struct pipe_context *pipe,
                        struct pipe_resource *indexBuffer,
                        unsigned indexSize,
@@ -128,3 +120,19 @@ llvmpipe_draw_elements(struct pipe_context *pipe,
                                  mode, start, count );
 }
 
+
+static void
+llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
+                     unsigned start, unsigned count)
+{
+   llvmpipe_draw_elements(pipe, NULL, 0, 0, mode, start, count);
+}
+
+
+void
+llvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe)
+{
+   llvmpipe->pipe.draw_arrays = llvmpipe_draw_arrays;
+   llvmpipe->pipe.draw_elements = llvmpipe_draw_elements;
+   llvmpipe->pipe.draw_range_elements = llvmpipe_draw_range_elements;
+}
index 3e015f3ecaa04880969df2ebcf892bc5fc77edba..23d71c1213c17c81f648abfd6afafdbee08d334e 100644 (file)
@@ -161,21 +161,6 @@ void llvmpipe_update_fs(struct llvmpipe_context *lp);
 void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe );
 
 
-void llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
-                            unsigned start, unsigned count);
-
-void llvmpipe_draw_elements(struct pipe_context *pipe,
-                              struct pipe_resource *indexBuffer,
-                              unsigned indexSize, int indexBias,
-                              unsigned mode, unsigned start, unsigned count);
-void
-llvmpipe_draw_range_elements(struct pipe_context *pipe,
-                             struct pipe_resource *indexBuffer,
-                             unsigned indexSize, int indexBias,
-                             unsigned min_index,
-                             unsigned max_index,
-                             unsigned mode, unsigned start, unsigned count);
-
 void
 llvmpipe_map_texture_surfaces(struct llvmpipe_context *lp);
 
@@ -192,4 +177,7 @@ llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe);
 void
 llvmpipe_init_vertex_funcs(struct llvmpipe_context *llvmpipe);
 
+void
+llvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe);
+
 #endif