Home | History | Annotate | Download | only in draw

Lines Matching refs:stage

29  * \brief  Clipping stage
58 struct draw_stage stage; /**< base class */
72 static INLINE struct clip_stage *clip_stage( struct draw_stage *stage )
74 return (struct clip_stage *)stage;
98 static void copy_flat( struct draw_stage *stage,
102 const struct clip_stage *clipper = clip_stage(stage);
120 const unsigned nr_attrs = draw_current_shader_outputs(clip->stage.draw);
121 const unsigned pos_attr = draw_current_shader_position_output(clip->stage.draw);
122 const unsigned clip_attr = draw_current_shader_clipvertex_output(clip->stage.draw);
144 const float *scale = clip->stage.draw->viewport.scale;
145 const float *trans = clip->stage.draw->viewport.translate;
188 * Emit a post-clip polygon to the next pipeline stage. The polygon
191 static void emit_poly( struct draw_stage *stage,
201 if (stage->draw->rasterizer->flatshade_first) {
222 if (stage->draw->rasterizer->flatshade_first) {
241 const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
244 stage->draw->rasterizer->flatshade_first);
256 stage->next->tri( stage->next, &header );
286 dp = vert->data[draw_current_shader_clipdistance_output(clipper->stage.draw, cdi)][vidx];
297 do_clip_tri( struct draw_stage *stage,
301 struct clip_stage *clipper = clip_stage( stage );
323 * Later, in the 'unfilled' pipeline stage we'll draw the edge if both
368 new_vert = clipper->stage.tmp[tmpnr++];
436 if (stage->draw->rasterizer->flatshade_first) {
441 inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
442 copy_flat(stage, inlist[0], header->v[0]);
450 inlist[0] = dup_vert(stage, inlist[0], tmpnr++);
451 copy_flat(stage, inlist[0], header->v[2]);
456 /* Emit the polygon as triangles to the setup stage:
458 emit_poly( stage, inlist, inEdges, n, header );
466 do_clip_line( struct draw_stage *stage,
470 const struct clip_stage *clipper = clip_stage( stage );
499 interp( clipper, stage->tmp[0], t0, v0, v1 );
500 copy_flat(stage, stage->tmp[0], v0);
501 newprim.v[0] = stage->tmp[0];
508 interp( clipper, stage->tmp[1], t1, v1, v0 );
509 newprim.v[1] = stage->tmp[1];
515 stage->next->line( stage->next, &newprim );
520 clip_point( struct draw_stage *stage,
524 stage->next->point( stage->next, header );
529 clip_line( struct draw_stage *stage,
537 stage->next->line( stage->next, header );
541 do_clip_line(stage, header, clipmask);
548 clip_tri( struct draw_stage *stage,
557 stage->next->tri( stage->next, header );
562 do_clip_tri(stage, header, clipmask);
571 clip_init_state( struct draw_stage *stage )
573 struct clip_stage *clipper = clip_stage( stage );
574 const struct draw_vertex_shader *vs = stage->draw->vs.vertex_shader;
575 const struct draw_fragment_shader *fs = stage->draw->fs.fragment_shader;
598 indexed_interp[0] = indexed_interp[1] = stage->draw->rasterizer->flatshade ?
656 stage->tri = clip_tri;
657 stage->line = clip_line;
662 static void clip_first_tri( struct draw_stage *stage,
665 clip_init_state( stage );
666 stage->tri( stage, header );
669 static void clip_first_line( struct draw_stage *stage,
672 clip_init_state( stage );
673 stage->line( stage, header );
677 static void clip_flush( struct draw_stage *stage,
680 stage->tri = clip_first_tri;
681 stage->line = clip_first_line;
682 stage->next->flush( stage->next, flags );
686 static void clip_reset_stipple_counter( struct draw_stage *stage )
688 stage->next->reset_stipple_counter( stage->next );
692 static void clip_destroy( struct draw_stage *stage )
694 draw_free_temp_verts( stage );
695 FREE( stage );
700 * Allocate a new clipper stage.
701 * \return pointer to new stage object
709 clipper->stage.draw = draw;
710 clipper->stage.name = "clipper";
711 clipper->stage.point = clip_point;
712 clipper->stage.line = clip_first_line;
713 clipper->stage.tri = clip_first_tri;
714 clipper->stage.flush = clip_flush;
715 clipper->stage.reset_stipple_counter = clip_reset_stipple_counter;
716 clipper->stage.destroy = clip_destroy;
720 if (!draw_alloc_temp_verts( &clipper->stage, MAX_CLIPPED_VERTICES+1 ))
723 return &clipper->stage;
727 clipper->stage.destroy( &clipper->stage );