Home | History | Annotate | Download | only in draw

Lines Matching refs:stage

42    struct draw_stage stage;
60 flat_stage(struct draw_stage *stage)
62 return (struct flat_stage *) stage;
67 static INLINE void copy_colors( struct draw_stage *stage,
71 const struct flat_stage *flat = flat_stage(stage);
87 static INLINE void copy_colors2( struct draw_stage *stage,
92 const struct flat_stage *flat = flat_stage(stage);
112 static void flatshade_tri_0( struct draw_stage *stage,
121 tmp.v[1] = dup_vert(stage, header->v[1], 0);
122 tmp.v[2] = dup_vert(stage, header->v[2], 1);
124 copy_colors2(stage, tmp.v[1], tmp.v[2], tmp.v[0]);
126 stage->next->tri( stage->next, &tmp );
130 static void flatshade_tri_2( struct draw_stage *stage,
138 tmp.v[0] = dup_vert(stage, header->v[0], 0);
139 tmp.v[1] = dup_vert(stage, header->v[1], 1);
142 copy_colors2(stage, tmp.v[0], tmp.v[1], tmp.v[2]);
144 stage->next->tri( stage->next, &tmp );
154 static void flatshade_line_0( struct draw_stage *stage,
160 tmp.v[1] = dup_vert(stage, header->v[1], 0);
162 copy_colors(stage, tmp.v[1], tmp.v[0]);
164 stage->next->line( stage->next, &tmp );
167 static void flatshade_line_1( struct draw_stage *stage,
172 tmp.v[0] = dup_vert(stage, header->v[0], 0);
175 copy_colors(stage, tmp.v[0], tmp.v[1]);
177 stage->next->line( stage->next, &tmp );
183 static void flatshade_init_state( struct draw_stage *stage )
185 struct flat_stage *flat = flat_stage(stage);
186 const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
204 if (stage->draw->rasterizer->flatshade_first) {
205 stage->line = flatshade_line_0;
206 stage->tri = flatshade_tri_0;
209 stage->line = flatshade_line_1;
210 stage->tri = flatshade_tri_2;
214 static void flatshade_first_tri( struct draw_stage *stage,
217 flatshade_init_state( stage );
218 stage->tri( stage, header );
221 static void flatshade_first_line( struct draw_stage *stage,
224 flatshade_init_state( stage );
225 stage->line( stage, header );
229 static void flatshade_flush( struct draw_stage *stage,
232 stage->tri = flatshade_first_tri;
233 stage->line = flatshade_first_line;
234 stage->next->flush( stage->next, flags );
238 static void flatshade_reset_stipple_counter( struct draw_stage *stage )
240 stage->next->reset_stipple_counter( stage->next );
244 static void flatshade_destroy( struct draw_stage *stage )
246 draw_free_temp_verts( stage );
247 FREE( stage );
252 * Create flatshading drawing stage.
260 flatshade->stage.draw = draw;
261 flatshade->stage.name = "flatshade";
262 flatshade->stage.next = NULL;
263 flatshade->stage.point = draw_pipe_passthrough_point;
264 flatshade->stage.line = flatshade_first_line;
265 flatshade->stage.tri = flatshade_first_tri;
266 flatshade->stage.flush = flatshade_flush;
267 flatshade->stage.reset_stipple_counter = flatshade_reset_stipple_counter;
268 flatshade->stage.destroy = flatshade_destroy;
270 if (!draw_alloc_temp_verts( &flatshade->stage, 2 ))
273 return &flatshade->stage;
277 flatshade->stage.destroy( &flatshade->stage );