From 507337864fa80caf9f26602324d2c28dd0a75d61 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 24 Apr 2012 19:52:26 +0200 Subject: gallium: change set_constant_buffer to be UBO-friendly --- src/gallium/include/pipe/p_context.h | 3 ++- src/gallium/include/pipe/p_state.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/gallium/include') diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 8b4a1588b86..1871b214610 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -41,6 +41,7 @@ struct pipe_blend_color; struct pipe_blend_state; struct pipe_box; struct pipe_clip_state; +struct pipe_constant_buffer; struct pipe_depth_stencil_alpha_state; struct pipe_draw_info; struct pipe_fence_handle; @@ -194,7 +195,7 @@ struct pipe_context { void (*set_constant_buffer)( struct pipe_context *, uint shader, uint index, - struct pipe_resource *buf ); + struct pipe_constant_buffer *buf ); void (*set_framebuffer_state)( struct pipe_context *, const struct pipe_framebuffer_state * ); diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index a459a56a760..42510a685bf 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -450,6 +450,17 @@ struct pipe_vertex_buffer }; +/** + * A constant buffer. A subrange of an existing buffer can be set + * as a constant buffer. + */ +struct pipe_constant_buffer { + struct pipe_resource *buffer; /**< the actual buffer */ + unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */ + unsigned buffer_size; /**< how much data can be read in shader */ +}; + + /** * A stream output target. The structure specifies the range vertices can * be written to. -- cgit v1.2.3