diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-09-06 17:07:09 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-09-06 17:07:09 -0600 |
commit | 63a51aee86f76ae54fb1ce572d584fb0f01aaec5 (patch) | |
tree | d506eebeccfc1365bd2dd982c497fe1d14be2117 /src/mesa/pipe/draw/draw_context.c | |
parent | 41ddd76b98e9e236a796f1bb9480ea0b2fb18010 (diff) |
Initial work for post-transformed vertex feedback buffers.
This will be used for:
GL_NV_transform_feedback, or similar GL3 functionality
glRasterPos
GL selection/feedback modes
Diffstat (limited to 'src/mesa/pipe/draw/draw_context.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_context.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/mesa/pipe/draw/draw_context.c b/src/mesa/pipe/draw/draw_context.c index 2936a14d65..3c095810e5 100644 --- a/src/mesa/pipe/draw/draw_context.c +++ b/src/mesa/pipe/draw/draw_context.c @@ -137,7 +137,12 @@ static void validate_pipeline( struct draw_context *draw ) draw->pipeline.flatshade->next = next; next = draw->pipeline.flatshade; } - + + if (draw->feedback.enabled || draw->feedback.discard) { + draw->pipeline.feedback->next = next; + next = draw->pipeline.feedback; + } + draw->pipeline.first = next; } @@ -190,6 +195,14 @@ void draw_set_viewport_state( struct draw_context *draw, void +draw_set_vertex_shader(struct draw_context *draw, + const struct pipe_shader_state *shader) +{ + draw->vertex_shader = *shader; +} + + +void draw_set_vertex_buffer(struct draw_context *draw, unsigned attr, const struct pipe_vertex_buffer *buffer) @@ -209,9 +222,30 @@ draw_set_vertex_element(struct draw_context *draw, } +/** + * Tell drawing context where to find mapped vertex buffers. + */ void -draw_set_vertex_shader(struct draw_context *draw, - const struct pipe_shader_state *shader) +draw_set_mapped_vertex_buffer(struct draw_context *draw, + unsigned attr, const void *buffer) { - draw->vertex_shader = *shader; + draw->mapped_vbuffer[attr] = buffer; +} + + +void +draw_set_mapped_constant_buffer(struct draw_context *draw, + const void *buffer) +{ + draw->mapped_constants = buffer; } + + +void +draw_set_mapped_feedback_buffer(struct draw_context *draw, uint index, + void *buffer, uint size) +{ + draw->mapped_feedback_buffer[index] = buffer; + draw->mapped_feedback_buffer_size[index] = size; /* in bytes */ +} + |