Additional parameters to vbuf_render->draw()
authorBrian <brian.paul@tungstengraphics.com>
Fri, 11 Jan 2008 00:01:11 +0000 (17:01 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 11 Jan 2008 00:01:11 +0000 (17:01 -0700)
Pass complete information about vertex/index buffer location, size, etc.

src/mesa/pipe/draw/draw_vbuf.c
src/mesa/pipe/draw/draw_vbuf.h
src/mesa/pipe/i915simple/i915_prim_vbuf.c

index d010aaba07609b72bba62e0c90fb2b5acff67627..3f6606de86f660653b01d563e2d85b9096a8f609 100644 (file)
@@ -291,8 +291,14 @@ vbuf_flush_indices( struct draw_stage *stage )
       assert(0);
    }
    
-   vbuf->render->draw(vbuf->render, vbuf->indices, vbuf->nr_indices);
-   
+   vbuf->render->draw( vbuf->render,
+                       vbuf->prim,
+                       vbuf->indices,
+                       vbuf->nr_indices,
+                       vbuf->vertices,
+                       vbuf->nr_vertices,
+                       vbuf->vertex_size );
+
    vbuf->nr_indices = 0;
 }
 
@@ -373,7 +379,7 @@ static void vbuf_destroy( struct draw_stage *stage )
 {
    struct vbuf_stage *vbuf = vbuf_stage( stage );
 
-   FREE( vbuf->indices );
+   align_free( vbuf->indices );
    FREE( stage );
 }
 
@@ -399,7 +405,7 @@ struct draw_stage *draw_vbuf_stage( struct draw_context *draw,
 
    assert(render->max_indices < UNDEFINED_VERTEX_ID);
    vbuf->max_indices = render->max_indices;
-   vbuf->indices = MALLOC( vbuf->max_indices );
+   vbuf->indices = align_malloc( vbuf->max_indices, 16 );
    
    vbuf->vertices = NULL;
    vbuf->vertex_ptr = vbuf->vertices;
index 43aa740f6464e5559038f2e4d5de302c975e7051..be4c4ab77bcaaac8932801d8e0b8df9618f8b9a2 100644 (file)
@@ -82,8 +82,12 @@ struct vbuf_render {
     * DrawElements, note indices are ushort:
     */
    void (*draw)( struct vbuf_render *,
+                 uint prim,
                 const ushort *indices,
-                unsigned nr_indices );
+                uint nr_indices,
+                 const void *vertices,
+                 uint nr_vertices,
+                 uint vertex_bytes);
 
    /**
     * Called when vbuf is done with this set of vertices:
index 571ad40595a3c6bd3534ee5cb335df11922a3e4d..bdcc027ed7b2d66f56ecdf99007624e8f637eac6 100644 (file)
@@ -136,8 +136,12 @@ i915_vbuf_render_set_primitive( struct vbuf_render *render,
 
 static void 
 i915_vbuf_render_draw( struct vbuf_render *render,
+                       uint prim,
                        const ushort *indices,
-                       unsigned nr_indices ) 
+                       uint nr_indices,
+                       const void *vertices,
+                       uint nr_vertices,
+                       uint vertex_bytes)
 {
    struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
    struct i915_context *i915 = i915_render->i915;