diff options
author | Keith Whitwell <[email protected]> | 2009-02-17 12:07:09 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-02-17 12:07:09 +0000 |
commit | befa4ff50ec4728de70c04532f8c7342fbd70147 (patch) | |
tree | 3ad8401102877c13d51465502128c28be6f3658b /src/gallium/auxiliary/draw/draw_vbuf.h | |
parent | c5c383596ddb26cd75e4b355918ad16915283b59 (diff) |
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.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vbuf.h')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vbuf.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vbuf.h b/src/gallium/auxiliary/draw/draw_vbuf.h index a1c4c14445b..cccd3bf4358 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 * ); }; |