diff options
author | Zack Rusin <[email protected]> | 2010-05-28 13:14:07 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-06-08 06:28:10 -0400 |
commit | a45b7f47ee0e38b288cc8fc4f6a1c013e8c227bc (patch) | |
tree | 39d93f4236a0068db6f515b2f0681c6da4dc016d /src/gallium/include/pipe | |
parent | a2817f6ae566b672f195cff22e14e2058d3617ea (diff) |
gallium: basic and initial implementation of the stream output interface
aka transform feedback
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r-- | src/gallium/include/pipe/p_context.h | 12 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 2 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 7 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 3e082bef2ff..0267ed8fa4a 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -186,6 +186,11 @@ struct pipe_context { void (*bind_vertex_elements_state)(struct pipe_context *, void *); void (*delete_vertex_elements_state)(struct pipe_context *, void *); + void * (*create_stream_output_state)(struct pipe_context *, + const struct pipe_stream_output_state *); + void (*bind_stream_output_state)(struct pipe_context *, void *); + void (*delete_stream_output_state)(struct pipe_context*, void*); + /*@}*/ /** @@ -232,6 +237,13 @@ struct pipe_context { unsigned num_buffers, const struct pipe_vertex_buffer * ); + void (*set_stream_output_buffers)(struct pipe_context *, + struct pipe_resource **buffers, + int *offsets, /*array of offsets + from the start of each + of the buffers */ + int num_buffers); + /*@}*/ diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index b00677425ce..be42c272221 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -288,6 +288,7 @@ enum pipe_transfer_usage { #define PIPE_BIND_DISPLAY_TARGET (1 << 8) /* flush_front_buffer */ #define PIPE_BIND_TRANSFER_WRITE (1 << 9) /* get_transfer */ #define PIPE_BIND_TRANSFER_READ (1 << 10) /* get_transfer */ +#define PIPE_BIND_STREAM_OUTPUT (1 << 11) /* set_stream_output_buffers */ #define PIPE_BIND_CUSTOM (1 << 16) /* state-tracker/winsys usages */ /* The first two flags above were previously part of the amorphous @@ -322,6 +323,7 @@ enum pipe_transfer_usage { #define PIPE_USAGE_STATIC 2 /* same as immutable?? */ #define PIPE_USAGE_IMMUTABLE 3 /* no change after first upload */ #define PIPE_USAGE_STREAM 4 /* upload, draw, upload, draw */ +#define PIPE_USAGE_STAGING 5 /* supports data transfers from the GPU to the CPU */ /* These are intended to be used in calls to is_format_supported, but diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 5255b2003f8..33ee066c0c9 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -63,6 +63,7 @@ extern "C" { #define PIPE_MAX_SHADER_INPUTS 16 #define PIPE_MAX_SHADER_OUTPUTS 16 #define PIPE_MAX_TEXTURE_LEVELS 16 +#define PIPE_MAX_SO_BUFFERS 4 struct pipe_reference @@ -345,6 +346,12 @@ struct pipe_resource unsigned flags; /**< bitmask of PIPE_RESOURCE_FLAG_x */ }; +struct pipe_stream_output_state +{ + /**< format for each output */ + enum pipe_format format[PIPE_MAX_SHADER_OUTPUTS]; + int num_outputs; +}; /** * Extra indexing info for (cube) texture resources. |