From 60e5fe65067da76dea816535bec1e9073adc0ba7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 24 Feb 2009 12:29:09 +0000 Subject: gallium: Allow to specify how much will be read / was written in buffer map/unmap. This allows the pipe driver to do more efficient DMA upload/downloads, by avoiding to read/write unneeded/unmodified data. --- src/gallium/include/pipe/p_screen.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/gallium/include/pipe/p_screen.h') diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 341d1caea0..69db80ee3f 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -56,6 +56,13 @@ struct pipe_buffer; +struct pipe_buffer_range +{ + unsigned offset; + unsigned size; +}; + + /** * Gallium screen/adapter context. Basically everything * hardware-specific that doesn't actually require a rendering @@ -213,6 +220,27 @@ struct pipe_screen { void (*buffer_unmap)( struct pipe_screen *screen, struct pipe_buffer *buf ); + /** + * Map a subrange of the buffer data store into the client's address space. + * + * Return pointer is always relative to offset 0, regardless of the + * read/write ranges. + */ + void *(*buffer_map_range)( struct pipe_screen *screen, + struct pipe_buffer *buf, + struct pipe_buffer_range read, + struct pipe_buffer_range write, + unsigned usage /* XXX: deprecated? */); + + /** + * Unmap a buffer. + * + * written is the range that the client actually wrote. + */ + void (*buffer_unmap_range)( struct pipe_screen *screen, + struct pipe_buffer *buf, + struct pipe_buffer_range written); + void (*buffer_destroy)( struct pipe_screen *screen, struct pipe_buffer *buf ); -- cgit v1.2.3