From 95794abec4bdc5cda9f2e7d139a70c3acf372fe3 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 6 Aug 2007 10:15:30 +0100 Subject: Add pipe buffer managment functions. The state_tracker driver needs these to implement, eg. pixel buffer objects, vertex buffer objects. --- src/mesa/pipe/p_context.h | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'src/mesa/pipe/p_context.h') diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 92670c7733..76a2593567 100644 --- a/src/mesa/pipe/p_context.h +++ b/src/mesa/pipe/p_context.h @@ -169,9 +169,44 @@ struct pipe_context { GLuint width, GLuint height, GLuint value); - struct _DriBufferObject *(*region_buffer)(struct pipe_context *pipe, - struct pipe_region *region, - GLuint flag); + + /* Buffer management functions need to be exposed as well. A pipe + * buffer may be used as a texture, render target or vertex/index + * buffer, or some combination according to flags. + */ + + struct pipe_buffer_handle *(*create_buffer)(struct pipe_context *pipe, + unsigned alignment, + unsigned flags ); + + void *(*buffer_map)( struct pipe_context *pipe, + struct pipe_buffer_handle *buf, + unsigned flags ); + + void (*buffer_unmap)( struct pipe_context *pipe, + struct pipe_buffer_handle *buf ); + + struct pipe_buffer_handle *(*buffer_reference)( struct pipe_context *pipe, + struct pipe_buffer_handle *buf ); + + void (*buffer_unreference)( struct pipe_context *pipe, + struct pipe_buffer_handle **buf ); + + void (*buffer_data)(struct pipe_context *pipe, + struct pipe_buffer_handle *buf, + unsigned size, const void *data ); + + void (*buffer_subdata)(struct pipe_context *pipe, + struct pipe_buffer_handle *buf, + unsigned long offset, + unsigned long size, + const void *data); + + void (*buffer_get_subdata)(struct pipe_context *pipe, + struct pipe_buffer_handle *buf, + unsigned long offset, + unsigned long size, + void *data); }; -- cgit v1.2.3