f2334a84f633453db1c0daba6b51c293db2b65f0
3 static void FUNC( struct draw_pt_front_end
*frontend
,
8 struct vcache_frontend
*vcache
= (struct vcache_frontend
*)frontend
;
9 struct draw_context
*draw
= vcache
->draw
;
13 if (0) debug_printf("%s %d\n", __FUNCTION__
, count
);
15 /* Note that no adjustment is made here for flatshade provoking
16 * vertex. This was previously the case, but was incorrect as the
17 * same logic would be applied twice both here & in the pipeline
18 * code or driver. The rule is now that we just preserve the
19 * original order in this code, and leave identification of the PV
20 * to the pipeline and driver.
22 switch (vcache
->input_prim
) {
23 case PIPE_PRIM_POINTS
:
24 for (i
= 0; i
< count
; i
++) {
26 get_elt(elts
, i
+ 0) );
31 for (i
= 0; i
+1 < count
; i
+= 2) {
33 DRAW_PIPE_RESET_STIPPLE
,
35 get_elt(elts
, i
+ 1));
39 case PIPE_PRIM_LINE_LOOP
:
41 flags
= DRAW_PIPE_RESET_STIPPLE
;
43 for (i
= 1; i
< count
; i
++, flags
= 0) {
57 case PIPE_PRIM_LINE_STRIP
:
58 flags
= DRAW_PIPE_RESET_STIPPLE
;
59 for (i
= 1; i
< count
; i
++, flags
= 0) {
67 case PIPE_PRIM_TRIANGLES
:
68 for (i
= 0; i
+2 < count
; i
+= 3) {
70 DRAW_PIPE_RESET_STIPPLE
| DRAW_PIPE_EDGE_FLAG_ALL
,
73 get_elt(elts
, i
+ 2 ));
77 case PIPE_PRIM_TRIANGLE_STRIP
:
78 for (i
= 0; i
+2 < count
; i
++) {
80 DRAW_PIPE_RESET_STIPPLE
| DRAW_PIPE_EDGE_FLAG_ALL
,
81 get_elt(elts
, i
+ 0 + (i
&1)),
82 get_elt(elts
, i
+ 1 - (i
&1)),
83 get_elt(elts
, i
+ 2 ));
87 case PIPE_PRIM_TRIANGLE_FAN
:
89 for (i
= 0; i
+2 < count
; i
++) {
91 DRAW_PIPE_RESET_STIPPLE
| DRAW_PIPE_EDGE_FLAG_ALL
,
100 case PIPE_PRIM_QUADS
:
101 for (i
= 0; i
+3 < count
; i
+= 4) {
103 get_elt(elts
, i
+ 0),
104 get_elt(elts
, i
+ 1),
105 get_elt(elts
, i
+ 2),
106 get_elt(elts
, i
+ 3));
110 case PIPE_PRIM_QUAD_STRIP
:
111 for (i
= 0; i
+3 < count
; i
+= 2) {
113 get_elt(elts
, i
+ 2),
114 get_elt(elts
, i
+ 0),
115 get_elt(elts
, i
+ 1),
116 get_elt(elts
, i
+ 3));
120 case PIPE_PRIM_POLYGON
:
122 boolean flatfirst
= (draw
->rasterizer
->flatshade
&&
123 draw
->rasterizer
->flatshade_first
);
125 /* These bitflags look a little odd because we submit the
126 * vertices as (1,2,0) to satisfy flatshade requirements.
128 * Polygon is defined has having vertex 0 be the provoking
129 * flatshade vertex and all known API's match this usage.
130 * However, the PV's for the triangles we emit from this
131 * decomposition vary according to the API, and hence we have
132 * to choose between two ways of emitting the triangles.
135 const ushort edge_first
= DRAW_PIPE_EDGE_FLAG_0
;
136 const ushort edge_middle
= DRAW_PIPE_EDGE_FLAG_1
;
137 const ushort edge_last
= DRAW_PIPE_EDGE_FLAG_2
;
139 flags
= DRAW_PIPE_RESET_STIPPLE
| edge_first
| edge_middle
;
141 for (i
= 0; i
+2 < count
; i
++, flags
= edge_middle
) {
146 /* PV is first vertex */
150 get_elt(elts
, i
+ 1),
151 get_elt(elts
, i
+ 2));
155 const ushort edge_first
= DRAW_PIPE_EDGE_FLAG_2
;
156 const ushort edge_middle
= DRAW_PIPE_EDGE_FLAG_0
;
157 const ushort edge_last
= DRAW_PIPE_EDGE_FLAG_1
;
159 flags
= DRAW_PIPE_RESET_STIPPLE
| edge_first
| edge_middle
;
161 for (i
= 0; i
+2 < count
; i
++, flags
= edge_middle
) {
166 /* PV is third vertex */
169 get_elt(elts
, i
+ 1),
170 get_elt(elts
, i
+ 2),
182 vcache_flush( vcache
);