diff options
Diffstat (limited to 'src/mesa/pipe/draw/draw_stipple.c')
-rw-r--r-- | src/mesa/pipe/draw/draw_stipple.c | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/src/mesa/pipe/draw/draw_stipple.c b/src/mesa/pipe/draw/draw_stipple.c index 3e0d5689e1..9029101916 100644 --- a/src/mesa/pipe/draw/draw_stipple.c +++ b/src/mesa/pipe/draw/draw_stipple.c @@ -61,6 +61,7 @@ stipple_stage(struct draw_stage *stage) /** * Compute interpolated vertex attributes for 'dst' at position 't' * between 'v0' and 'v1'. + * XXX using linear interpolation for all attribs at this time. */ static void screen_interp( struct draw_context *draw, @@ -70,28 +71,13 @@ screen_interp( struct draw_context *draw, const struct vertex_header *v1 ) { uint attr; - for (attr = 0; attr < draw->vertex_info.num_attribs; attr++) { - switch (draw->vertex_info.interp_mode[attr]) { - case INTERP_NONE: - case INTERP_CONSTANT: - COPY_4FV(dst->data[attr], v0->data[attr]); - break; - case INTERP_PERSPECTIVE: - /* Fall-through */ - /* XXX special-case perspective? */ - case INTERP_LINEAR: - { - const float *val0 = v0->data[attr]; - const float *val1 = v1->data[attr]; - float *newv = dst->data[attr]; - uint i; - for (i = 0; i < 4; i++) { - newv[i] = val0[i] + t * (val1[i] - val0[i]); - } - } - break; - default: - abort(); + for (attr = 0; attr < draw->num_vs_outputs; attr++) { + const float *val0 = v0->data[attr]; + const float *val1 = v1->data[attr]; + float *newv = dst->data[attr]; + uint i; + for (i = 0; i < 4; i++) { + newv[i] = val0[i] + t * (val1[i] - val0[i]); } } } @@ -187,7 +173,8 @@ reset_stipple_counter(struct draw_stage *stage) static void -stipple_begin(struct draw_stage *stage) +stipple_first_line(struct draw_stage *stage, + struct prim_header *header) { struct stipple_stage *stipple = stipple_stage(stage); struct draw_context *draw = stage->draw; @@ -195,14 +182,16 @@ stipple_begin(struct draw_stage *stage) stipple->pattern = draw->rasterizer->line_stipple_pattern; stipple->factor = draw->rasterizer->line_stipple_factor + 1; - stage->next->begin( stage->next ); + stage->line = stipple_line; + stage->line( stage, header ); } static void -stipple_end(struct draw_stage *stage) +stipple_flush(struct draw_stage *stage, unsigned flags) { - stage->next->end( stage->next ); + stage->line = stipple_first_line; + stage->next->flush( stage->next, flags ); } @@ -238,12 +227,11 @@ struct draw_stage *draw_stipple_stage( struct draw_context *draw ) stipple->stage.draw = draw; stipple->stage.next = NULL; - stipple->stage.begin = stipple_begin; stipple->stage.point = passthrough_point; - stipple->stage.line = stipple_line; + stipple->stage.line = stipple_first_line; stipple->stage.tri = passthrough_tri; stipple->stage.reset_stipple_counter = reset_stipple_counter; - stipple->stage.end = stipple_end; + stipple->stage.flush = stipple_flush; stipple->stage.destroy = stipple_destroy; return &stipple->stage; |