From 63a51aee86f76ae54fb1ce572d584fb0f01aaec5 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 6 Sep 2007 17:07:09 -0600 Subject: 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 --- src/mesa/pipe/draw/draw_context.c | 42 +++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) (limited to 'src/mesa/pipe/draw/draw_context.c') diff --git a/src/mesa/pipe/draw/draw_context.c b/src/mesa/pipe/draw/draw_context.c index 2936a14d65a..3c095810e55 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; } @@ -189,6 +194,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, @@ -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 */ +} + -- cgit v1.2.3