From cac8892ddb24ddb92b6f367689712925ee6c2d86 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 10 Jan 2008 17:01:11 -0700 Subject: Additional parameters to vbuf_render->draw() Pass complete information about vertex/index buffer location, size, etc. --- src/mesa/pipe/draw/draw_vbuf.c | 14 ++++++++++---- src/mesa/pipe/draw/draw_vbuf.h | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/mesa/pipe/draw') diff --git a/src/mesa/pipe/draw/draw_vbuf.c b/src/mesa/pipe/draw/draw_vbuf.c index d010aaba07..3f6606de86 100644 --- a/src/mesa/pipe/draw/draw_vbuf.c +++ b/src/mesa/pipe/draw/draw_vbuf.c @@ -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; diff --git a/src/mesa/pipe/draw/draw_vbuf.h b/src/mesa/pipe/draw/draw_vbuf.h index 43aa740f64..be4c4ab77b 100644 --- a/src/mesa/pipe/draw/draw_vbuf.h +++ b/src/mesa/pipe/draw/draw_vbuf.h @@ -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: -- cgit v1.2.3