summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
committerMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
commitbb4c5d72d7c7cb1d9e7016e2c07c36875f30011a (patch)
tree153444ff535900f82ae63b5af8ccd09fb2f063af /src/gallium/include
parent96956dc5076fc03b9290368ca90e3f3b870ee613 (diff)
parent8dd3e341b337ca2d22bcc0e7548a78a6c36ca77d (diff)
Merge branch 'gallium-userbuf'
Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_context.h12
-rw-r--r--src/gallium/include/pipe/p_defines.h5
-rw-r--r--src/gallium/include/pipe/p_state.h17
3 files changed, 20 insertions, 14 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index 0951e70f481..f59e3881232 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;
@@ -199,7 +200,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 * );
@@ -414,15 +415,6 @@ struct pipe_context {
unsigned stride,
unsigned layer_stride);
-
- /* Notify a driver that a content of a user buffer has been changed.
- * The changed range is [offset, offset+size-1].
- * The new width0 of the buffer is offset+size. */
- void (*redefine_user_buffer)(struct pipe_context *,
- struct pipe_resource *,
- unsigned offset,
- unsigned size);
-
/**
* Flush any pending framebuffer writes and invalidate texture caches.
*/
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index edcca23746b..1e05cc4caee 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -481,7 +481,10 @@ enum pipe_cap {
PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY = 65,
PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY = 66,
PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY = 67,
- PIPE_CAP_COMPUTE = 68
+ PIPE_CAP_COMPUTE = 68,
+ PIPE_CAP_USER_INDEX_BUFFERS = 69,
+ PIPE_CAP_USER_CONSTANT_BUFFERS = 70,
+ PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT = 71
};
/**
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 02cd1fdfafb..51a956d9532 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -417,9 +417,6 @@ struct pipe_resource
unsigned bind; /**< bitmask of PIPE_BIND_x */
unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */
-
- /* XXX this is only temporary and will be removed once it's not needed */
- uint8_t *user_ptr; /**< user buffer pointer */
};
@@ -449,6 +446,19 @@ struct pipe_vertex_buffer
unsigned stride; /**< stride to same attrib in next vertex, in bytes */
unsigned buffer_offset; /**< offset to start of data in buffer, in bytes */
struct pipe_resource *buffer; /**< the actual buffer */
+ const void *user_buffer; /**< pointer to a user buffer if buffer == NULL */
+};
+
+
+/**
+ * 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 */
+ const void *user_buffer; /**< pointer to a user buffer if buffer == NULL */
};
@@ -507,6 +517,7 @@ struct pipe_index_buffer
unsigned index_size; /**< size of an index, in bytes */
unsigned offset; /**< offset to start of data in buffer, in bytes */
struct pipe_resource *buffer; /**< the actual buffer */
+ const void *user_buffer; /**< pointer to a user buffer if buffer == NULL */
};