diff options
author | Keith Whitwell <[email protected]> | 2007-08-06 10:15:30 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2007-08-06 10:15:30 +0100 |
commit | 95794abec4bdc5cda9f2e7d139a70c3acf372fe3 (patch) | |
tree | 31b3c2550363639bccd6a8d1e72a860f196800f7 /src/mesa/pipe/p_context.h | |
parent | 1d1b9e6be45e75ad12a01c82e3c0d55ff9da4183 (diff) |
Add pipe buffer managment functions.
The state_tracker driver needs these to implement, eg. pixel buffer objects,
vertex buffer objects.
Diffstat (limited to 'src/mesa/pipe/p_context.h')
-rw-r--r-- | src/mesa/pipe/p_context.h | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h index 92670c77337..76a25935672 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); }; |