From 1e0d30a515e4cac891b6c590f12a33e0e8a8e295 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 25 Jan 2008 20:53:31 +0000 Subject: gallium: rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code Provide an actual definition of the pipe_buffer struct, containing the parameters used to create the buffer, and its refcount. Shift refcounting buffers out of the winsys interface, similar to surfaces & textures. Rework pipebuffer/ to reflect the fact these changes, and also Michel's reworking of the buffer interface. --- src/mesa/pipe/p_state.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/mesa/pipe/p_state.h') diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h index 146a479cf3..83ca43f678 100644 --- a/src/mesa/pipe/p_state.h +++ b/src/mesa/pipe/p_state.h @@ -60,8 +60,21 @@ struct pipe_surface; struct pipe_winsys; -/* opaque type */ -struct pipe_buffer_handle; + + +/** + * The driver will certainly subclass this to include actual memory + * management information. + */ +struct pipe_buffer { + unsigned alignment; + unsigned usage; + unsigned size; + + /** Reference count */ + unsigned refcount; +}; + @@ -129,7 +142,7 @@ struct pipe_clip_state { * Constants for vertex/fragment shaders */ struct pipe_constant_buffer { - struct pipe_buffer_handle *buffer; + struct pipe_buffer *buffer; unsigned size; /** in bytes */ }; @@ -240,7 +253,7 @@ struct pipe_sampler_state */ struct pipe_surface { - struct pipe_buffer_handle *buffer; /**< driver private buffer handle */ + struct pipe_buffer *buffer; /**< driver private buffer handle */ enum pipe_format format; /**< PIPE_FORMAT_x */ unsigned status; /**< PIPE_SURFACE_STATUS_x */ unsigned clear_value; /**< may be temporary */ @@ -290,7 +303,7 @@ struct pipe_vertex_buffer unsigned pitch:11; /**< stride to same attrib in next vertex, in bytes */ unsigned max_index; /**< number of vertices in this buffer */ unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */ - struct pipe_buffer_handle *buffer; /**< the actual buffer */ + struct pipe_buffer *buffer; /**< the actual buffer */ }; -- cgit v1.2.3