replace void * with struct draw_vertex_shader opaque type
authorBrian <brian.paul@tungstengraphics.com>
Thu, 3 Jan 2008 22:03:52 +0000 (15:03 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 3 Jan 2008 22:03:52 +0000 (15:03 -0700)
src/mesa/pipe/draw/draw_context.h
src/mesa/pipe/draw/draw_vertex_shader.c
src/mesa/pipe/i915simple/i915_state.c
src/mesa/pipe/softpipe/sp_state.h

index 6dc6e4c..60be3e1 100644 (file)
@@ -45,6 +45,7 @@ struct vertex_buffer;
 struct vertex_info;
 struct draw_context;
 struct draw_stage;
+struct draw_vertex_shader;
 
 
 /**
@@ -89,12 +90,13 @@ void draw_set_rasterize_stage( struct draw_context *draw,
                                struct draw_stage *stage );
 
 
-void * draw_create_vertex_shader(struct draw_context *draw,
-                                 const struct pipe_shader_state *shader);
+struct draw_vertex_shader *
+draw_create_vertex_shader(struct draw_context *draw,
+                          const struct pipe_shader_state *shader);
 void draw_bind_vertex_shader(struct draw_context *draw,
-                             void *vcso);
+                             struct draw_vertex_shader *dvs);
 void draw_delete_vertex_shader(struct draw_context *draw,
-                               void *vcso);
+                               struct draw_vertex_shader *dvs);
 
 boolean draw_use_sse(struct draw_context *draw);
 
index d34d923..1fa9af8 100644 (file)
@@ -227,7 +227,7 @@ void draw_vertex_shader_queue_flush( struct draw_context *draw )
 }
 
 
-void *
+struct draw_vertex_shader *
 draw_create_vertex_shader(struct draw_context *draw,
                           const struct pipe_shader_state *shader)
 {
@@ -263,10 +263,10 @@ draw_create_vertex_shader(struct draw_context *draw,
 }
 
 void draw_bind_vertex_shader(struct draw_context *draw,
-                             void *vcso)
+                             struct draw_vertex_shader *dvs)
 {
    draw_flush(draw);
-   draw->vertex_shader = (struct draw_vertex_shader*)(vcso);
+   draw->vertex_shader = dvs;
 
    /* specify the fragment program to interpret/execute */
    tgsi_exec_machine_init(&draw->machine,
@@ -276,15 +276,11 @@ void draw_bind_vertex_shader(struct draw_context *draw,
 }
 
 void draw_delete_vertex_shader(struct draw_context *draw,
-                               void *vcso)
+                               struct draw_vertex_shader *dvs)
 {
-   struct draw_vertex_shader *vs;
-
-   vs = (struct draw_vertex_shader *) vcso;
-
 #if defined(__i386__) || defined(__386__)
-   x86_release_func( (struct x86_function *) &vs->sse2_program );
+   x86_release_func( (struct x86_function *) &dvs->sse2_program );
 #endif
 
-   FREE( vs );
+   FREE( dvs );
 }
index f8332aa..1190e05 100644 (file)
@@ -438,12 +438,12 @@ i915_create_vs_state(struct pipe_context *pipe,
    return draw_create_vertex_shader(i915->draw, templ);
 }
 
-static void i915_bind_vs_state(struct pipe_context *pipe, void *vs)
+static void i915_bind_vs_state(struct pipe_context *pipe, void *shader)
 {
    struct i915_context *i915 = i915_context(pipe);
 
    /* just pass-through to draw module */
-   draw_bind_vertex_shader(i915->draw, vs);
+   draw_bind_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader);
 }
 
 static void i915_delete_vs_state(struct pipe_context *pipe, void *shader)
@@ -451,7 +451,7 @@ static void i915_delete_vs_state(struct pipe_context *pipe, void *shader)
    struct i915_context *i915 = i915_context(pipe);
 
    /* just pass-through to draw module */
-   draw_delete_vertex_shader(i915->draw, shader);
+   draw_delete_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader);
 }
 
 static void i915_set_constant_buffer(struct pipe_context *pipe,
index c1f5555..bac7b08 100644 (file)
@@ -75,7 +75,7 @@ struct sp_fragment_shader_state {
 /** Subclass of pipe_shader_state */
 struct sp_vertex_shader_state {
    struct pipe_shader_state shader;
-   void  *draw_data;
+   struct draw_vertex_shader *draw_data;
 };