gallium: rename draw() to draw_elements() in vbuf code
authorBrian Paul <brianp@vmware.com>
Wed, 5 May 2010 20:00:58 +0000 (14:00 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 6 May 2010 00:19:37 +0000 (18:19 -0600)
Now we have draw_elements() and draw_arrays() to be consistent with the
pipe_context drawing functions.

src/gallium/auxiliary/draw/draw_pipe_vbuf.c
src/gallium/auxiliary/draw/draw_pt_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
src/gallium/auxiliary/draw/draw_vbuf.h
src/gallium/drivers/i915/i915_prim_vbuf.c
src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/softpipe/sp_prim_vbuf.c
src/gallium/drivers/svga/svga_swtnl_backend.c

index 1fd083e54d01299b5ca0eba63a7a03f1359a8c0b..3c93c9014a605c08c1c29bcba7e2095bcf69d392 100644 (file)
@@ -324,9 +324,9 @@ vbuf_flush_vertices( struct vbuf_stage *vbuf )
 
       if (vbuf->nr_indices) 
       {
-         vbuf->render->draw(vbuf->render, 
-                            vbuf->indices, 
-                            vbuf->nr_indices );
+         vbuf->render->draw_elements(vbuf->render, 
+                                     vbuf->indices, 
+                                     vbuf->nr_indices );
    
          vbuf->nr_indices = 0;
       }
index ad48fa39a4f0ad751058b9b91f07e50bc07cb080..f623c0743da17160c342ef3ca885c5042758e956 100644 (file)
@@ -190,9 +190,9 @@ void draw_pt_emit( struct pt_emit *emit,
                            0, 
                            vertex_count - 1 );
 
-   render->draw(render,
-               elts,
-               count);
+   render->draw_elements(render,
+                         elts,
+                         count);
 
    render->release_vertices(render);
 }
index d7735bf1ac9dcf0642eb08cd473bae520439205b..5158c6341c016ecddec14b458e17e5fb8b8c8831 100644 (file)
@@ -254,9 +254,9 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
    /* XXX: Draw arrays path to avoid re-emitting index list again and
     * again.
     */
-   draw->render->draw( draw->render, 
-                       draw_elts, 
-                       draw_count );
+   draw->render->draw_elements( draw->render, 
+                                draw_elts, 
+                                draw_count );
 
    /* Done -- that was easy, wasn't it: 
     */
@@ -363,9 +363,9 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
    /* XXX: Draw arrays path to avoid re-emitting index list again and
     * again.
     */
-   draw->render->draw( draw->render, 
-                       draw_elts, 
-                       draw_count );
+   draw->render->draw_elements( draw->render, 
+                                draw_elts, 
+                                draw_count );
 
    /* Done -- that was easy, wasn't it:
     */
index cbb5b6c960535e6320b61a67f003a1035b61a120..f0fc591bf558741af96fe49dd34d204b174d6b4b 100644 (file)
@@ -307,9 +307,9 @@ fse_run(struct draw_pt_middle_end *middle,
 
    draw->render->unmap_vertices( draw->render, 0, (ushort)(fetch_count - 1) );
    
-   draw->render->draw( draw->render, 
-                       draw_elts, 
-                       draw_count );
+   draw->render->draw_elements( draw->render, 
+                                draw_elts, 
+                                draw_count );
 
 
    draw->render->release_vertices( draw->render );
@@ -357,9 +357,9 @@ static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
                             hw_verts );
 
 
-   draw->render->draw( draw->render, 
-                       draw_elts, 
-                       draw_count );
+   draw->render->draw_elements( draw->render, 
+                                draw_elts, 
+                                draw_count );
    
 
    draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
index cccd3bf4358d4ac5e97c21cfd1daf80829a0ebb5..83ae26a9c2b365e5e1e38a29d16b80852b87d8a0 100644 (file)
@@ -98,14 +98,14 @@ struct vbuf_render {
    boolean (*set_primitive)( struct vbuf_render *, unsigned prim );
 
    /**
-    * DrawElements, note indices are ushort.  The driver must complete
-    * this call, if necessary splitting the index list itself.
+    * Draw indexed primitives.  Note that indices are ushort.  The driver
+    * must complete this call, if necessary splitting the index list itself.
     */
-   void (*draw)( struct vbuf_render *,
-                const ushort *indices,
-                uint nr_indices );
+   void (*draw_elements)( struct vbuf_render *,
+                          const ushort *indices,
+                          uint nr_indices );
 
-   /* Draw Arrays path too.
+   /* Draw non-indexed primitives.
     */
    void (*draw_arrays)( struct vbuf_render *,
                        unsigned start,
index df9e68af4fcd4fb882b885ddfb86b99250449315..f8665acbe18975bbd33ad7c9ca8f4eb734f777b1 100644 (file)
@@ -544,9 +544,9 @@ draw_calc_nr_indices(uint nr_indices, unsigned type)
 }
 
 static void 
-i915_vbuf_render_draw(struct vbuf_render *render,
-                      const ushort *indices,
-                      uint nr_indices)
+i915_vbuf_render_draw_elements(struct vbuf_render *render,
+                               const ushort *indices,
+                               uint nr_indices)
 {
    struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
    struct i915_context *i915 = i915_render->i915;
@@ -638,7 +638,7 @@ i915_vbuf_render_create(struct i915_context *i915)
    i915_render->base.map_vertices = i915_vbuf_render_map_vertices;
    i915_render->base.unmap_vertices = i915_vbuf_render_unmap_vertices;
    i915_render->base.set_primitive = i915_vbuf_render_set_primitive;
-   i915_render->base.draw = i915_vbuf_render_draw;
+   i915_render->base.draw_elements = i915_vbuf_render_draw_elements;
    i915_render->base.draw_arrays = i915_vbuf_render_draw_arrays;
    i915_render->base.release_vertices = i915_vbuf_render_release_vertices;
    i915_render->base.destroy = i915_vbuf_render_destroy;
index 4d775735421500eedf4130ef82de172d1678e1fe..f6a424f25a833575480baac47fcecef618fe8d77 100644 (file)
@@ -131,7 +131,7 @@ static INLINE const_float4_ptr get_vert( const void *vertex_buffer,
  * draw elements / indexed primitives
  */
 static void
-lp_setup_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
+lp_setup_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr)
 {
    struct lp_setup_context *setup = lp_setup_context(vbr);
    const unsigned stride = setup->vertex_info->size * sizeof(float);
@@ -543,7 +543,7 @@ lp_setup_init_vbuf(struct lp_setup_context *setup)
    setup->base.map_vertices = lp_setup_map_vertices;
    setup->base.unmap_vertices = lp_setup_unmap_vertices;
    setup->base.set_primitive = lp_setup_set_primitive;
-   setup->base.draw = lp_setup_draw;
+   setup->base.draw_elements = lp_setup_draw_elements;
    setup->base.draw_arrays = lp_setup_draw_arrays;
    setup->base.release_vertices = lp_setup_release_vertices;
    setup->base.destroy = lp_setup_vbuf_destroy;
index 7c3a7902a49372a680284a926cae116cca95b9b5..d04c8ea81e6d24d4a29f396b673ff27cc857832c 100644 (file)
@@ -913,9 +913,9 @@ static void r500_render_draw_arrays(struct vbuf_render* render,
     END_CS;
 }
 
-static void r500_render_draw(struct vbuf_render* render,
-                             const ushort* indices,
-                             uint count)
+static void r500_render_draw_elements(struct vbuf_render* render,
+                                      const ushort* indices,
+                                      uint count)
 {
     struct r300_render* r300render = r300_render(render);
     struct r300_context* r300 = r300render->r300;
@@ -960,19 +960,19 @@ static void r300_render_draw_arrays(struct vbuf_render* render,
     }
 }
 
-static void r300_render_draw(struct vbuf_render* render,
-                             const ushort* indices,
-                             uint count)
+static void r300_render_draw_elements(struct vbuf_render* render,
+                                      const ushort* indices,
+                                      uint count)
 {
     struct r300_context* r300 = r300_render(render)->r300;
 
     if (!r300->stencil_ref_bf_fallback) {
-        r500_render_draw(render, indices, count);
+        r500_render_draw_elements(render, indices, count);
     } else {
         r300_begin_stencil_ref_fallback(r300);
-        r500_render_draw(render, indices, count);
+        r500_render_draw_elements(render, indices, count);
         r300_switch_stencil_ref_side(r300);
-        r500_render_draw(render, indices, count);
+        r500_render_draw_elements(render, indices, count);
         r300_end_stencil_ref_fallback(r300);
     }
 }
@@ -998,10 +998,10 @@ static struct vbuf_render* r300_render_create(struct r300_context* r300)
     r300render->base.unmap_vertices = r300_render_unmap_vertices;
     r300render->base.set_primitive = r300_render_set_primitive;
     if (r300->screen->caps.is_r500) {
-        r300render->base.draw = r500_render_draw;
+        r300render->base.draw_elements = r500_render_draw_elements;
         r300render->base.draw_arrays = r500_render_draw_arrays;
     } else {
-        r300render->base.draw = r300_render_draw;
+        r300render->base.draw_elements = r300_render_draw_elements;
         r300render->base.draw_arrays = r300_render_draw_arrays;
     }
     r300render->base.release_vertices = r300_render_release_vertices;
index 0168b32037105cdb7e4ad5cec9275da7f41e4649..db0d1755103620ff679b0205e61752715f7bfd61 100644 (file)
@@ -158,7 +158,7 @@ static INLINE cptrf4 get_vert( const void *vertex_buffer,
  * draw elements / indexed primitives
  */
 static void
-sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr)
+sp_vbuf_draw_elements(struct vbuf_render *vbr, const ushort *indices, uint nr)
 {
    struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
    struct softpipe_context *softpipe = cvbr->softpipe;
@@ -572,7 +572,7 @@ sp_create_vbuf_backend(struct softpipe_context *sp)
    cvbr->base.map_vertices = sp_vbuf_map_vertices;
    cvbr->base.unmap_vertices = sp_vbuf_unmap_vertices;
    cvbr->base.set_primitive = sp_vbuf_set_primitive;
-   cvbr->base.draw = sp_vbuf_draw;
+   cvbr->base.draw_elements = sp_vbuf_draw_elements;
    cvbr->base.draw_arrays = sp_vbuf_draw_arrays;
    cvbr->base.release_vertices = sp_vbuf_release_vertices;
    cvbr->base.destroy = sp_vbuf_destroy;
index b0cbead8a5cb2d6362cb6fa9b48470bff449201a..ff3da842729e183e6cd072b7bfd933a8f29f8834 100644 (file)
@@ -240,9 +240,9 @@ svga_vbuf_render_draw_arrays( struct vbuf_render *render,
 
 
 static void
-svga_vbuf_render_draw( struct vbuf_render *render,
-                       const ushort *indices,
-                       uint nr_indices)
+svga_vbuf_render_draw_elements( struct vbuf_render *render,
+                                const ushort *indices,
+                                uint nr_indices)
 {
    struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
    struct svga_context *svga = svga_render->svga;
@@ -341,7 +341,7 @@ svga_vbuf_render_create( struct svga_context *svga )
    svga_render->base.map_vertices = svga_vbuf_render_map_vertices;
    svga_render->base.unmap_vertices = svga_vbuf_render_unmap_vertices;
    svga_render->base.set_primitive = svga_vbuf_render_set_primitive;
-   svga_render->base.draw = svga_vbuf_render_draw;
+   svga_render->base.draw_elements = svga_vbuf_render_draw_elements;
    svga_render->base.draw_arrays = svga_vbuf_render_draw_arrays;
    svga_render->base.release_vertices = svga_vbuf_render_release_vertices;
    svga_render->base.destroy = svga_vbuf_render_destroy;