diff options
Diffstat (limited to 'src/mesa/pipe/draw')
-rw-r--r-- | src/mesa/pipe/draw/draw_context.c | 10 | ||||
-rw-r--r-- | src/mesa/pipe/draw/draw_context.h | 3 | ||||
-rw-r--r-- | src/mesa/pipe/draw/draw_feedback.c | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/pipe/draw/draw_context.c b/src/mesa/pipe/draw/draw_context.c index 3c095810e55..4498293e92b 100644 --- a/src/mesa/pipe/draw/draw_context.c +++ b/src/mesa/pipe/draw/draw_context.c @@ -48,6 +48,7 @@ struct draw_context *draw_create( void ) draw->pipeline.clip = draw_clip_stage( draw ); draw->pipeline.flatshade = draw_flatshade_stage( draw ); draw->pipeline.cull = draw_cull_stage( draw ); + draw->pipeline.feedback = draw_feedback_stage( draw ); ASSIGN_4V( draw->plane[0], -1, 0, 0, 1 ); ASSIGN_4V( draw->plane[1], 1, 0, 0, 1 ); @@ -147,6 +148,14 @@ static void validate_pipeline( struct draw_context *draw ) } +void draw_set_feedback_state( struct draw_context *draw, + const struct pipe_feedback_state *feedback ) +{ + draw->feedback = *feedback; + validate_pipeline( draw ); +} + + /** * Register new primitive setup/rendering state. * This causes the drawing pipeline to be rebuilt. @@ -245,6 +254,7 @@ void draw_set_mapped_feedback_buffer(struct draw_context *draw, uint index, void *buffer, uint size) { + assert(index < PIPE_MAX_FEEDBACK_ATTRIBS); draw->mapped_feedback_buffer[index] = buffer; draw->mapped_feedback_buffer_size[index] = size; /* in bytes */ } diff --git a/src/mesa/pipe/draw/draw_context.h b/src/mesa/pipe/draw/draw_context.h index 50315749693..2babc02f45f 100644 --- a/src/mesa/pipe/draw/draw_context.h +++ b/src/mesa/pipe/draw/draw_context.h @@ -83,6 +83,9 @@ void draw_set_viewport_state( struct draw_context *draw, void draw_set_clip_state( struct draw_context *pipe, const struct pipe_clip_state *clip ); +void draw_set_feedback_state( struct draw_context *draw, + const struct pipe_feedback_state * ); + void draw_set_setup_state( struct draw_context *draw, const struct pipe_setup_state *setup ); diff --git a/src/mesa/pipe/draw/draw_feedback.c b/src/mesa/pipe/draw/draw_feedback.c index 2729f44dc69..ecdd98e83d7 100644 --- a/src/mesa/pipe/draw/draw_feedback.c +++ b/src/mesa/pipe/draw/draw_feedback.c @@ -81,7 +81,8 @@ feedback_vertex(struct draw_stage *stage, const struct vertex_header *vertex) for (i = 0; i < feedback->num_attribs; i++) { const uint attr = feedback->attrib[i]; - const float *src = attr ? vertex->data[attr] : vertex->clip; + const uint slot = stage->draw->vertex_info.attrib_to_slot[attr]; + const float *src = attr ? vertex->data[slot] : vertex->clip; const uint size = feedback->size[i]; float *dest = fs->dest[i * select]; |