From befa4ff50ec4728de70c04532f8c7342fbd70147 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 17 Feb 2009 12:07:09 +0000 Subject: draw: add map/unmap directives for swtnl driver interface Previously draw module asked for a pointer into (mapped) vertex data, which it would incrementally fill and emit draw commands against. This was hard for the drivers to deal with, especially in the case where a draw command would force a flush and thus an unmap of the vertex data. With this change, the draw module explicitly maps & then unmaps vertex data prior to emitting draw commands. --- src/gallium/auxiliary/draw/draw_vbuf.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_vbuf.h') diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index a1c4c14445..cccd3bf435 100644 --- a/src/gallium/auxiliary/draw/draw_vbuf.h +++ b/src/gallium/auxiliary/draw/draw_vbuf.h @@ -80,9 +80,14 @@ struct vbuf_render { * Hardware renderers will use ttm memory, others will just malloc * something. */ - void *(*allocate_vertices)( struct vbuf_render *, - ushort vertex_size, - ushort nr_vertices ); + boolean (*allocate_vertices)( struct vbuf_render *, + ushort vertex_size, + ushort nr_vertices ); + + void *(*map_vertices)( struct vbuf_render * ); + void (*unmap_vertices)( struct vbuf_render *, + ushort min_index, + ushort max_index ); /** * Notify the renderer of the current primitive when it changes. @@ -109,10 +114,7 @@ struct vbuf_render { /** * Called when vbuf is done with this set of vertices: */ - void (*release_vertices)( struct vbuf_render *, - void *vertices, - unsigned vertex_size, - unsigned vertices_used ); + void (*release_vertices)( struct vbuf_render * ); void (*destroy)( struct vbuf_render * ); }; -- cgit v1.2.3