python/retrace: Use colors on windows console.
[mesa.git] / src / gallium / auxiliary / indices / u_unfilled_gen.c
1 /* File automatically generated by u_unfilled_gen.py */
2
3 /*
4 * Copyright 2009 VMware, Inc.
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * on the rights to use, copy, modify, merge, publish, distribute, sub
11 * license, and/or sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
16 * Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28
29 /**
30 * @file
31 * Functions to translate and generate index lists
32 */
33
34 #include "indices/u_indices.h"
35 #include "indices/u_indices_priv.h"
36 #include "pipe/p_compiler.h"
37 #include "util/u_debug.h"
38 #include "pipe/p_defines.h"
39 #include "util/u_memory.h"
40
41
42 static unsigned out_size_idx( unsigned index_size )
43 {
44 switch (index_size) {
45 case 4: return OUT_UINT;
46 case 2: return OUT_USHORT;
47 default: assert(0); return OUT_USHORT;
48 }
49 }
50
51 static unsigned in_size_idx( unsigned index_size )
52 {
53 switch (index_size) {
54 case 4: return IN_UINT;
55 case 2: return IN_USHORT;
56 case 1: return IN_UBYTE;
57 default: assert(0); return IN_UBYTE;
58 }
59 }
60
61
62 static u_generate_func generate_line[OUT_COUNT][PRIM_COUNT];
63 static u_translate_func translate_line[IN_COUNT][OUT_COUNT][PRIM_COUNT];
64
65
66 static void generate_tris_ushort(
67 unsigned nr,
68 void *_out )
69 {
70 ushort *out = (ushort*)_out;
71 unsigned i, j;
72 (void)j;
73 for (j = i = 0; j < nr; j+=6, i+=3) {
74 debug_printf(" line %d %d\n", (int)i, (int)i+1);
75 (out+j)[0] = (ushort)(i);
76 (out+j)[1] = (ushort)(i+1);
77 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
78 (out+j+2)[0] = (ushort)(i+1);
79 (out+j+2)[1] = (ushort)(i+2);
80 debug_printf(" line %d %d\n", (int)i+2, (int)i);
81 (out+j+4)[0] = (ushort)(i+2);
82 (out+j+4)[1] = (ushort)(i);
83 }
84 }
85 static void generate_tristrip_ushort(
86 unsigned nr,
87 void *_out )
88 {
89 ushort *out = (ushort*)_out;
90 unsigned i, j;
91 (void)j;
92 for (j = i = 0; j < nr; j+=6, i++) {
93 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
94 (out+j)[0] = (ushort)(i);
95 (out+j)[1] = (ushort)(i+1/*+(i&1)*/);
96 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
97 (out+j+2)[0] = (ushort)(i+1/*+(i&1)*/);
98 (out+j+2)[1] = (ushort)(i+2/*-(i&1)*/);
99 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
100 (out+j+4)[0] = (ushort)(i+2/*-(i&1)*/);
101 (out+j+4)[1] = (ushort)(i);
102 }
103 }
104 static void generate_trifan_ushort(
105 unsigned nr,
106 void *_out )
107 {
108 ushort *out = (ushort*)_out;
109 unsigned i, j;
110 (void)j;
111 for (j = i = 0; j < nr; j+=6, i++) {
112 debug_printf(" line %d %d\n", (int)0, (int)i+1);
113 (out+j)[0] = (ushort)(0);
114 (out+j)[1] = (ushort)(i+1);
115 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
116 (out+j+2)[0] = (ushort)(i+1);
117 (out+j+2)[1] = (ushort)(i+2);
118 debug_printf(" line %d %d\n", (int)i+2, (int)0);
119 (out+j+4)[0] = (ushort)(i+2);
120 (out+j+4)[1] = (ushort)(0);
121 }
122 }
123 static void generate_quads_ushort(
124 unsigned nr,
125 void *_out )
126 {
127 ushort *out = (ushort*)_out;
128 unsigned i, j;
129 (void)j;
130 for (j = i = 0; j < nr; j+=8, i+=4) {
131 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
132 (out+j)[0] = (ushort)(i+0);
133 (out+j)[1] = (ushort)(i+1);
134 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
135 (out+j+2)[0] = (ushort)(i+1);
136 (out+j+2)[1] = (ushort)(i+2);
137 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
138 (out+j+4)[0] = (ushort)(i+2);
139 (out+j+4)[1] = (ushort)(i+3);
140 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
141 (out+j+6)[0] = (ushort)(i+3);
142 (out+j+6)[1] = (ushort)(i+0);
143 }
144 }
145 static void generate_quadstrip_ushort(
146 unsigned nr,
147 void *_out )
148 {
149 ushort *out = (ushort*)_out;
150 unsigned i, j;
151 (void)j;
152 for (j = i = 0; j < nr; j+=8, i+=2) {
153 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
154 (out+j)[0] = (ushort)(i+2);
155 (out+j)[1] = (ushort)(i+0);
156 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
157 (out+j+2)[0] = (ushort)(i+0);
158 (out+j+2)[1] = (ushort)(i+1);
159 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
160 (out+j+4)[0] = (ushort)(i+1);
161 (out+j+4)[1] = (ushort)(i+3);
162 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
163 (out+j+6)[0] = (ushort)(i+3);
164 (out+j+6)[1] = (ushort)(i+2);
165 }
166 }
167 static void generate_polygon_ushort(
168 unsigned nr,
169 void *_out )
170 {
171 ushort *out = (ushort*)_out;
172 unsigned i, j;
173 (void)j;
174 for (j = i = 0; j < nr; j+=6, i++) {
175 debug_printf(" line %d %d\n", (int)0, (int)i+1);
176 (out+j)[0] = (ushort)(0);
177 (out+j)[1] = (ushort)(i+1);
178 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
179 (out+j+2)[0] = (ushort)(i+1);
180 (out+j+2)[1] = (ushort)(i+2);
181 debug_printf(" line %d %d\n", (int)i+2, (int)0);
182 (out+j+4)[0] = (ushort)(i+2);
183 (out+j+4)[1] = (ushort)(0);
184 }
185 }
186 static void generate_tris_uint(
187 unsigned nr,
188 void *_out )
189 {
190 uint *out = (uint*)_out;
191 unsigned i, j;
192 (void)j;
193 for (j = i = 0; j < nr; j+=6, i+=3) {
194 debug_printf(" line %d %d\n", (int)i, (int)i+1);
195 (out+j)[0] = (uint)(i);
196 (out+j)[1] = (uint)(i+1);
197 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
198 (out+j+2)[0] = (uint)(i+1);
199 (out+j+2)[1] = (uint)(i+2);
200 debug_printf(" line %d %d\n", (int)i+2, (int)i);
201 (out+j+4)[0] = (uint)(i+2);
202 (out+j+4)[1] = (uint)(i);
203 }
204 }
205 static void generate_tristrip_uint(
206 unsigned nr,
207 void *_out )
208 {
209 uint *out = (uint*)_out;
210 unsigned i, j;
211 (void)j;
212 for (j = i = 0; j < nr; j+=6, i++) {
213 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
214 (out+j)[0] = (uint)(i);
215 (out+j)[1] = (uint)(i+1/*+(i&1)*/);
216 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
217 (out+j+2)[0] = (uint)(i+1/*+(i&1)*/);
218 (out+j+2)[1] = (uint)(i+2/*-(i&1)*/);
219 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
220 (out+j+4)[0] = (uint)(i+2/*-(i&1)*/);
221 (out+j+4)[1] = (uint)(i);
222 }
223 }
224 static void generate_trifan_uint(
225 unsigned nr,
226 void *_out )
227 {
228 uint *out = (uint*)_out;
229 unsigned i, j;
230 (void)j;
231 for (j = i = 0; j < nr; j+=6, i++) {
232 debug_printf(" line %d %d\n", (int)0, (int)i+1);
233 (out+j)[0] = (uint)(0);
234 (out+j)[1] = (uint)(i+1);
235 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
236 (out+j+2)[0] = (uint)(i+1);
237 (out+j+2)[1] = (uint)(i+2);
238 debug_printf(" line %d %d\n", (int)i+2, (int)0);
239 (out+j+4)[0] = (uint)(i+2);
240 (out+j+4)[1] = (uint)(0);
241 }
242 }
243 static void generate_quads_uint(
244 unsigned nr,
245 void *_out )
246 {
247 uint *out = (uint*)_out;
248 unsigned i, j;
249 (void)j;
250 for (j = i = 0; j < nr; j+=8, i+=4) {
251 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
252 (out+j)[0] = (uint)(i+0);
253 (out+j)[1] = (uint)(i+1);
254 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
255 (out+j+2)[0] = (uint)(i+1);
256 (out+j+2)[1] = (uint)(i+2);
257 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
258 (out+j+4)[0] = (uint)(i+2);
259 (out+j+4)[1] = (uint)(i+3);
260 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
261 (out+j+6)[0] = (uint)(i+3);
262 (out+j+6)[1] = (uint)(i+0);
263 }
264 }
265 static void generate_quadstrip_uint(
266 unsigned nr,
267 void *_out )
268 {
269 uint *out = (uint*)_out;
270 unsigned i, j;
271 (void)j;
272 for (j = i = 0; j < nr; j+=8, i+=2) {
273 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
274 (out+j)[0] = (uint)(i+2);
275 (out+j)[1] = (uint)(i+0);
276 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
277 (out+j+2)[0] = (uint)(i+0);
278 (out+j+2)[1] = (uint)(i+1);
279 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
280 (out+j+4)[0] = (uint)(i+1);
281 (out+j+4)[1] = (uint)(i+3);
282 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
283 (out+j+6)[0] = (uint)(i+3);
284 (out+j+6)[1] = (uint)(i+2);
285 }
286 }
287 static void generate_polygon_uint(
288 unsigned nr,
289 void *_out )
290 {
291 uint *out = (uint*)_out;
292 unsigned i, j;
293 (void)j;
294 for (j = i = 0; j < nr; j+=6, i++) {
295 debug_printf(" line %d %d\n", (int)0, (int)i+1);
296 (out+j)[0] = (uint)(0);
297 (out+j)[1] = (uint)(i+1);
298 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
299 (out+j+2)[0] = (uint)(i+1);
300 (out+j+2)[1] = (uint)(i+2);
301 debug_printf(" line %d %d\n", (int)i+2, (int)0);
302 (out+j+4)[0] = (uint)(i+2);
303 (out+j+4)[1] = (uint)(0);
304 }
305 }
306 static void translate_tris_ubyte2ushort(
307 const void * _in,
308 unsigned nr,
309 void *_out )
310 {
311 const ubyte*in = (const ubyte*)_in;
312 ushort *out = (ushort*)_out;
313 unsigned i, j;
314 (void)j;
315 for (j = i = 0; j < nr; j+=6, i+=3) {
316 debug_printf(" line %d %d\n", (int)i, (int)i+1);
317 (out+j)[0] = (ushort)in[i];
318 (out+j)[1] = (ushort)in[i+1];
319 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
320 (out+j+2)[0] = (ushort)in[i+1];
321 (out+j+2)[1] = (ushort)in[i+2];
322 debug_printf(" line %d %d\n", (int)i+2, (int)i);
323 (out+j+4)[0] = (ushort)in[i+2];
324 (out+j+4)[1] = (ushort)in[i];
325 }
326 }
327 static void translate_tristrip_ubyte2ushort(
328 const void * _in,
329 unsigned nr,
330 void *_out )
331 {
332 const ubyte*in = (const ubyte*)_in;
333 ushort *out = (ushort*)_out;
334 unsigned i, j;
335 (void)j;
336 for (j = i = 0; j < nr; j+=6, i++) {
337 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
338 (out+j)[0] = (ushort)in[i];
339 (out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
340 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
341 (out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
342 (out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
343 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
344 (out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
345 (out+j+4)[1] = (ushort)in[i];
346 }
347 }
348 static void translate_trifan_ubyte2ushort(
349 const void * _in,
350 unsigned nr,
351 void *_out )
352 {
353 const ubyte*in = (const ubyte*)_in;
354 ushort *out = (ushort*)_out;
355 unsigned i, j;
356 (void)j;
357 for (j = i = 0; j < nr; j+=6, i++) {
358 debug_printf(" line %d %d\n", (int)0, (int)i+1);
359 (out+j)[0] = (ushort)in[0];
360 (out+j)[1] = (ushort)in[i+1];
361 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
362 (out+j+2)[0] = (ushort)in[i+1];
363 (out+j+2)[1] = (ushort)in[i+2];
364 debug_printf(" line %d %d\n", (int)i+2, (int)0);
365 (out+j+4)[0] = (ushort)in[i+2];
366 (out+j+4)[1] = (ushort)in[0];
367 }
368 }
369 static void translate_quads_ubyte2ushort(
370 const void * _in,
371 unsigned nr,
372 void *_out )
373 {
374 const ubyte*in = (const ubyte*)_in;
375 ushort *out = (ushort*)_out;
376 unsigned i, j;
377 (void)j;
378 for (j = i = 0; j < nr; j+=8, i+=4) {
379 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
380 (out+j)[0] = (ushort)in[i+0];
381 (out+j)[1] = (ushort)in[i+1];
382 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
383 (out+j+2)[0] = (ushort)in[i+1];
384 (out+j+2)[1] = (ushort)in[i+2];
385 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
386 (out+j+4)[0] = (ushort)in[i+2];
387 (out+j+4)[1] = (ushort)in[i+3];
388 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
389 (out+j+6)[0] = (ushort)in[i+3];
390 (out+j+6)[1] = (ushort)in[i+0];
391 }
392 }
393 static void translate_quadstrip_ubyte2ushort(
394 const void * _in,
395 unsigned nr,
396 void *_out )
397 {
398 const ubyte*in = (const ubyte*)_in;
399 ushort *out = (ushort*)_out;
400 unsigned i, j;
401 (void)j;
402 for (j = i = 0; j < nr; j+=8, i+=2) {
403 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
404 (out+j)[0] = (ushort)in[i+2];
405 (out+j)[1] = (ushort)in[i+0];
406 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
407 (out+j+2)[0] = (ushort)in[i+0];
408 (out+j+2)[1] = (ushort)in[i+1];
409 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
410 (out+j+4)[0] = (ushort)in[i+1];
411 (out+j+4)[1] = (ushort)in[i+3];
412 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
413 (out+j+6)[0] = (ushort)in[i+3];
414 (out+j+6)[1] = (ushort)in[i+2];
415 }
416 }
417 static void translate_polygon_ubyte2ushort(
418 const void * _in,
419 unsigned nr,
420 void *_out )
421 {
422 const ubyte*in = (const ubyte*)_in;
423 ushort *out = (ushort*)_out;
424 unsigned i, j;
425 (void)j;
426 for (j = i = 0; j < nr; j+=6, i++) {
427 debug_printf(" line %d %d\n", (int)0, (int)i+1);
428 (out+j)[0] = (ushort)in[0];
429 (out+j)[1] = (ushort)in[i+1];
430 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
431 (out+j+2)[0] = (ushort)in[i+1];
432 (out+j+2)[1] = (ushort)in[i+2];
433 debug_printf(" line %d %d\n", (int)i+2, (int)0);
434 (out+j+4)[0] = (ushort)in[i+2];
435 (out+j+4)[1] = (ushort)in[0];
436 }
437 }
438 static void translate_tris_ubyte2uint(
439 const void * _in,
440 unsigned nr,
441 void *_out )
442 {
443 const ubyte*in = (const ubyte*)_in;
444 uint *out = (uint*)_out;
445 unsigned i, j;
446 (void)j;
447 for (j = i = 0; j < nr; j+=6, i+=3) {
448 debug_printf(" line %d %d\n", (int)i, (int)i+1);
449 (out+j)[0] = (uint)in[i];
450 (out+j)[1] = (uint)in[i+1];
451 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
452 (out+j+2)[0] = (uint)in[i+1];
453 (out+j+2)[1] = (uint)in[i+2];
454 debug_printf(" line %d %d\n", (int)i+2, (int)i);
455 (out+j+4)[0] = (uint)in[i+2];
456 (out+j+4)[1] = (uint)in[i];
457 }
458 }
459 static void translate_tristrip_ubyte2uint(
460 const void * _in,
461 unsigned nr,
462 void *_out )
463 {
464 const ubyte*in = (const ubyte*)_in;
465 uint *out = (uint*)_out;
466 unsigned i, j;
467 (void)j;
468 for (j = i = 0; j < nr; j+=6, i++) {
469 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
470 (out+j)[0] = (uint)in[i];
471 (out+j)[1] = (uint)in[i+1/*+(i&1)*/];
472 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
473 (out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
474 (out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
475 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
476 (out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
477 (out+j+4)[1] = (uint)in[i];
478 }
479 }
480 static void translate_trifan_ubyte2uint(
481 const void * _in,
482 unsigned nr,
483 void *_out )
484 {
485 const ubyte*in = (const ubyte*)_in;
486 uint *out = (uint*)_out;
487 unsigned i, j;
488 (void)j;
489 for (j = i = 0; j < nr; j+=6, i++) {
490 debug_printf(" line %d %d\n", (int)0, (int)i+1);
491 (out+j)[0] = (uint)in[0];
492 (out+j)[1] = (uint)in[i+1];
493 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
494 (out+j+2)[0] = (uint)in[i+1];
495 (out+j+2)[1] = (uint)in[i+2];
496 debug_printf(" line %d %d\n", (int)i+2, (int)0);
497 (out+j+4)[0] = (uint)in[i+2];
498 (out+j+4)[1] = (uint)in[0];
499 }
500 }
501 static void translate_quads_ubyte2uint(
502 const void * _in,
503 unsigned nr,
504 void *_out )
505 {
506 const ubyte*in = (const ubyte*)_in;
507 uint *out = (uint*)_out;
508 unsigned i, j;
509 (void)j;
510 for (j = i = 0; j < nr; j+=8, i+=4) {
511 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
512 (out+j)[0] = (uint)in[i+0];
513 (out+j)[1] = (uint)in[i+1];
514 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
515 (out+j+2)[0] = (uint)in[i+1];
516 (out+j+2)[1] = (uint)in[i+2];
517 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
518 (out+j+4)[0] = (uint)in[i+2];
519 (out+j+4)[1] = (uint)in[i+3];
520 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
521 (out+j+6)[0] = (uint)in[i+3];
522 (out+j+6)[1] = (uint)in[i+0];
523 }
524 }
525 static void translate_quadstrip_ubyte2uint(
526 const void * _in,
527 unsigned nr,
528 void *_out )
529 {
530 const ubyte*in = (const ubyte*)_in;
531 uint *out = (uint*)_out;
532 unsigned i, j;
533 (void)j;
534 for (j = i = 0; j < nr; j+=8, i+=2) {
535 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
536 (out+j)[0] = (uint)in[i+2];
537 (out+j)[1] = (uint)in[i+0];
538 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
539 (out+j+2)[0] = (uint)in[i+0];
540 (out+j+2)[1] = (uint)in[i+1];
541 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
542 (out+j+4)[0] = (uint)in[i+1];
543 (out+j+4)[1] = (uint)in[i+3];
544 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
545 (out+j+6)[0] = (uint)in[i+3];
546 (out+j+6)[1] = (uint)in[i+2];
547 }
548 }
549 static void translate_polygon_ubyte2uint(
550 const void * _in,
551 unsigned nr,
552 void *_out )
553 {
554 const ubyte*in = (const ubyte*)_in;
555 uint *out = (uint*)_out;
556 unsigned i, j;
557 (void)j;
558 for (j = i = 0; j < nr; j+=6, i++) {
559 debug_printf(" line %d %d\n", (int)0, (int)i+1);
560 (out+j)[0] = (uint)in[0];
561 (out+j)[1] = (uint)in[i+1];
562 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
563 (out+j+2)[0] = (uint)in[i+1];
564 (out+j+2)[1] = (uint)in[i+2];
565 debug_printf(" line %d %d\n", (int)i+2, (int)0);
566 (out+j+4)[0] = (uint)in[i+2];
567 (out+j+4)[1] = (uint)in[0];
568 }
569 }
570 static void translate_tris_ushort2ushort(
571 const void * _in,
572 unsigned nr,
573 void *_out )
574 {
575 const ushort*in = (const ushort*)_in;
576 ushort *out = (ushort*)_out;
577 unsigned i, j;
578 (void)j;
579 for (j = i = 0; j < nr; j+=6, i+=3) {
580 debug_printf(" line %d %d\n", (int)i, (int)i+1);
581 (out+j)[0] = (ushort)in[i];
582 (out+j)[1] = (ushort)in[i+1];
583 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
584 (out+j+2)[0] = (ushort)in[i+1];
585 (out+j+2)[1] = (ushort)in[i+2];
586 debug_printf(" line %d %d\n", (int)i+2, (int)i);
587 (out+j+4)[0] = (ushort)in[i+2];
588 (out+j+4)[1] = (ushort)in[i];
589 }
590 }
591 static void translate_tristrip_ushort2ushort(
592 const void * _in,
593 unsigned nr,
594 void *_out )
595 {
596 const ushort*in = (const ushort*)_in;
597 ushort *out = (ushort*)_out;
598 unsigned i, j;
599 (void)j;
600 for (j = i = 0; j < nr; j+=6, i++) {
601 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
602 (out+j)[0] = (ushort)in[i];
603 (out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
604 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
605 (out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
606 (out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
607 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
608 (out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
609 (out+j+4)[1] = (ushort)in[i];
610 }
611 }
612 static void translate_trifan_ushort2ushort(
613 const void * _in,
614 unsigned nr,
615 void *_out )
616 {
617 const ushort*in = (const ushort*)_in;
618 ushort *out = (ushort*)_out;
619 unsigned i, j;
620 (void)j;
621 for (j = i = 0; j < nr; j+=6, i++) {
622 debug_printf(" line %d %d\n", (int)0, (int)i+1);
623 (out+j)[0] = (ushort)in[0];
624 (out+j)[1] = (ushort)in[i+1];
625 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
626 (out+j+2)[0] = (ushort)in[i+1];
627 (out+j+2)[1] = (ushort)in[i+2];
628 debug_printf(" line %d %d\n", (int)i+2, (int)0);
629 (out+j+4)[0] = (ushort)in[i+2];
630 (out+j+4)[1] = (ushort)in[0];
631 }
632 }
633 static void translate_quads_ushort2ushort(
634 const void * _in,
635 unsigned nr,
636 void *_out )
637 {
638 const ushort*in = (const ushort*)_in;
639 ushort *out = (ushort*)_out;
640 unsigned i, j;
641 (void)j;
642 for (j = i = 0; j < nr; j+=8, i+=4) {
643 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
644 (out+j)[0] = (ushort)in[i+0];
645 (out+j)[1] = (ushort)in[i+1];
646 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
647 (out+j+2)[0] = (ushort)in[i+1];
648 (out+j+2)[1] = (ushort)in[i+2];
649 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
650 (out+j+4)[0] = (ushort)in[i+2];
651 (out+j+4)[1] = (ushort)in[i+3];
652 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
653 (out+j+6)[0] = (ushort)in[i+3];
654 (out+j+6)[1] = (ushort)in[i+0];
655 }
656 }
657 static void translate_quadstrip_ushort2ushort(
658 const void * _in,
659 unsigned nr,
660 void *_out )
661 {
662 const ushort*in = (const ushort*)_in;
663 ushort *out = (ushort*)_out;
664 unsigned i, j;
665 (void)j;
666 for (j = i = 0; j < nr; j+=8, i+=2) {
667 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
668 (out+j)[0] = (ushort)in[i+2];
669 (out+j)[1] = (ushort)in[i+0];
670 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
671 (out+j+2)[0] = (ushort)in[i+0];
672 (out+j+2)[1] = (ushort)in[i+1];
673 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
674 (out+j+4)[0] = (ushort)in[i+1];
675 (out+j+4)[1] = (ushort)in[i+3];
676 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
677 (out+j+6)[0] = (ushort)in[i+3];
678 (out+j+6)[1] = (ushort)in[i+2];
679 }
680 }
681 static void translate_polygon_ushort2ushort(
682 const void * _in,
683 unsigned nr,
684 void *_out )
685 {
686 const ushort*in = (const ushort*)_in;
687 ushort *out = (ushort*)_out;
688 unsigned i, j;
689 (void)j;
690 for (j = i = 0; j < nr; j+=6, i++) {
691 debug_printf(" line %d %d\n", (int)0, (int)i+1);
692 (out+j)[0] = (ushort)in[0];
693 (out+j)[1] = (ushort)in[i+1];
694 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
695 (out+j+2)[0] = (ushort)in[i+1];
696 (out+j+2)[1] = (ushort)in[i+2];
697 debug_printf(" line %d %d\n", (int)i+2, (int)0);
698 (out+j+4)[0] = (ushort)in[i+2];
699 (out+j+4)[1] = (ushort)in[0];
700 }
701 }
702 static void translate_tris_ushort2uint(
703 const void * _in,
704 unsigned nr,
705 void *_out )
706 {
707 const ushort*in = (const ushort*)_in;
708 uint *out = (uint*)_out;
709 unsigned i, j;
710 (void)j;
711 for (j = i = 0; j < nr; j+=6, i+=3) {
712 debug_printf(" line %d %d\n", (int)i, (int)i+1);
713 (out+j)[0] = (uint)in[i];
714 (out+j)[1] = (uint)in[i+1];
715 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
716 (out+j+2)[0] = (uint)in[i+1];
717 (out+j+2)[1] = (uint)in[i+2];
718 debug_printf(" line %d %d\n", (int)i+2, (int)i);
719 (out+j+4)[0] = (uint)in[i+2];
720 (out+j+4)[1] = (uint)in[i];
721 }
722 }
723 static void translate_tristrip_ushort2uint(
724 const void * _in,
725 unsigned nr,
726 void *_out )
727 {
728 const ushort*in = (const ushort*)_in;
729 uint *out = (uint*)_out;
730 unsigned i, j;
731 (void)j;
732 for (j = i = 0; j < nr; j+=6, i++) {
733 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
734 (out+j)[0] = (uint)in[i];
735 (out+j)[1] = (uint)in[i+1/*+(i&1)*/];
736 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
737 (out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
738 (out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
739 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
740 (out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
741 (out+j+4)[1] = (uint)in[i];
742 }
743 }
744 static void translate_trifan_ushort2uint(
745 const void * _in,
746 unsigned nr,
747 void *_out )
748 {
749 const ushort*in = (const ushort*)_in;
750 uint *out = (uint*)_out;
751 unsigned i, j;
752 (void)j;
753 for (j = i = 0; j < nr; j+=6, i++) {
754 debug_printf(" line %d %d\n", (int)0, (int)i+1);
755 (out+j)[0] = (uint)in[0];
756 (out+j)[1] = (uint)in[i+1];
757 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
758 (out+j+2)[0] = (uint)in[i+1];
759 (out+j+2)[1] = (uint)in[i+2];
760 debug_printf(" line %d %d\n", (int)i+2, (int)0);
761 (out+j+4)[0] = (uint)in[i+2];
762 (out+j+4)[1] = (uint)in[0];
763 }
764 }
765 static void translate_quads_ushort2uint(
766 const void * _in,
767 unsigned nr,
768 void *_out )
769 {
770 const ushort*in = (const ushort*)_in;
771 uint *out = (uint*)_out;
772 unsigned i, j;
773 (void)j;
774 for (j = i = 0; j < nr; j+=8, i+=4) {
775 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
776 (out+j)[0] = (uint)in[i+0];
777 (out+j)[1] = (uint)in[i+1];
778 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
779 (out+j+2)[0] = (uint)in[i+1];
780 (out+j+2)[1] = (uint)in[i+2];
781 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
782 (out+j+4)[0] = (uint)in[i+2];
783 (out+j+4)[1] = (uint)in[i+3];
784 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
785 (out+j+6)[0] = (uint)in[i+3];
786 (out+j+6)[1] = (uint)in[i+0];
787 }
788 }
789 static void translate_quadstrip_ushort2uint(
790 const void * _in,
791 unsigned nr,
792 void *_out )
793 {
794 const ushort*in = (const ushort*)_in;
795 uint *out = (uint*)_out;
796 unsigned i, j;
797 (void)j;
798 for (j = i = 0; j < nr; j+=8, i+=2) {
799 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
800 (out+j)[0] = (uint)in[i+2];
801 (out+j)[1] = (uint)in[i+0];
802 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
803 (out+j+2)[0] = (uint)in[i+0];
804 (out+j+2)[1] = (uint)in[i+1];
805 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
806 (out+j+4)[0] = (uint)in[i+1];
807 (out+j+4)[1] = (uint)in[i+3];
808 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
809 (out+j+6)[0] = (uint)in[i+3];
810 (out+j+6)[1] = (uint)in[i+2];
811 }
812 }
813 static void translate_polygon_ushort2uint(
814 const void * _in,
815 unsigned nr,
816 void *_out )
817 {
818 const ushort*in = (const ushort*)_in;
819 uint *out = (uint*)_out;
820 unsigned i, j;
821 (void)j;
822 for (j = i = 0; j < nr; j+=6, i++) {
823 debug_printf(" line %d %d\n", (int)0, (int)i+1);
824 (out+j)[0] = (uint)in[0];
825 (out+j)[1] = (uint)in[i+1];
826 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
827 (out+j+2)[0] = (uint)in[i+1];
828 (out+j+2)[1] = (uint)in[i+2];
829 debug_printf(" line %d %d\n", (int)i+2, (int)0);
830 (out+j+4)[0] = (uint)in[i+2];
831 (out+j+4)[1] = (uint)in[0];
832 }
833 }
834 static void translate_tris_uint2ushort(
835 const void * _in,
836 unsigned nr,
837 void *_out )
838 {
839 const uint*in = (const uint*)_in;
840 ushort *out = (ushort*)_out;
841 unsigned i, j;
842 (void)j;
843 for (j = i = 0; j < nr; j+=6, i+=3) {
844 debug_printf(" line %d %d\n", (int)i, (int)i+1);
845 (out+j)[0] = (ushort)in[i];
846 (out+j)[1] = (ushort)in[i+1];
847 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
848 (out+j+2)[0] = (ushort)in[i+1];
849 (out+j+2)[1] = (ushort)in[i+2];
850 debug_printf(" line %d %d\n", (int)i+2, (int)i);
851 (out+j+4)[0] = (ushort)in[i+2];
852 (out+j+4)[1] = (ushort)in[i];
853 }
854 }
855 static void translate_tristrip_uint2ushort(
856 const void * _in,
857 unsigned nr,
858 void *_out )
859 {
860 const uint*in = (const uint*)_in;
861 ushort *out = (ushort*)_out;
862 unsigned i, j;
863 (void)j;
864 for (j = i = 0; j < nr; j+=6, i++) {
865 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
866 (out+j)[0] = (ushort)in[i];
867 (out+j)[1] = (ushort)in[i+1/*+(i&1)*/];
868 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
869 (out+j+2)[0] = (ushort)in[i+1/*+(i&1)*/];
870 (out+j+2)[1] = (ushort)in[i+2/*-(i&1)*/];
871 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
872 (out+j+4)[0] = (ushort)in[i+2/*-(i&1)*/];
873 (out+j+4)[1] = (ushort)in[i];
874 }
875 }
876 static void translate_trifan_uint2ushort(
877 const void * _in,
878 unsigned nr,
879 void *_out )
880 {
881 const uint*in = (const uint*)_in;
882 ushort *out = (ushort*)_out;
883 unsigned i, j;
884 (void)j;
885 for (j = i = 0; j < nr; j+=6, i++) {
886 debug_printf(" line %d %d\n", (int)0, (int)i+1);
887 (out+j)[0] = (ushort)in[0];
888 (out+j)[1] = (ushort)in[i+1];
889 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
890 (out+j+2)[0] = (ushort)in[i+1];
891 (out+j+2)[1] = (ushort)in[i+2];
892 debug_printf(" line %d %d\n", (int)i+2, (int)0);
893 (out+j+4)[0] = (ushort)in[i+2];
894 (out+j+4)[1] = (ushort)in[0];
895 }
896 }
897 static void translate_quads_uint2ushort(
898 const void * _in,
899 unsigned nr,
900 void *_out )
901 {
902 const uint*in = (const uint*)_in;
903 ushort *out = (ushort*)_out;
904 unsigned i, j;
905 (void)j;
906 for (j = i = 0; j < nr; j+=8, i+=4) {
907 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
908 (out+j)[0] = (ushort)in[i+0];
909 (out+j)[1] = (ushort)in[i+1];
910 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
911 (out+j+2)[0] = (ushort)in[i+1];
912 (out+j+2)[1] = (ushort)in[i+2];
913 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
914 (out+j+4)[0] = (ushort)in[i+2];
915 (out+j+4)[1] = (ushort)in[i+3];
916 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
917 (out+j+6)[0] = (ushort)in[i+3];
918 (out+j+6)[1] = (ushort)in[i+0];
919 }
920 }
921 static void translate_quadstrip_uint2ushort(
922 const void * _in,
923 unsigned nr,
924 void *_out )
925 {
926 const uint*in = (const uint*)_in;
927 ushort *out = (ushort*)_out;
928 unsigned i, j;
929 (void)j;
930 for (j = i = 0; j < nr; j+=8, i+=2) {
931 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
932 (out+j)[0] = (ushort)in[i+2];
933 (out+j)[1] = (ushort)in[i+0];
934 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
935 (out+j+2)[0] = (ushort)in[i+0];
936 (out+j+2)[1] = (ushort)in[i+1];
937 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
938 (out+j+4)[0] = (ushort)in[i+1];
939 (out+j+4)[1] = (ushort)in[i+3];
940 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
941 (out+j+6)[0] = (ushort)in[i+3];
942 (out+j+6)[1] = (ushort)in[i+2];
943 }
944 }
945 static void translate_polygon_uint2ushort(
946 const void * _in,
947 unsigned nr,
948 void *_out )
949 {
950 const uint*in = (const uint*)_in;
951 ushort *out = (ushort*)_out;
952 unsigned i, j;
953 (void)j;
954 for (j = i = 0; j < nr; j+=6, i++) {
955 debug_printf(" line %d %d\n", (int)0, (int)i+1);
956 (out+j)[0] = (ushort)in[0];
957 (out+j)[1] = (ushort)in[i+1];
958 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
959 (out+j+2)[0] = (ushort)in[i+1];
960 (out+j+2)[1] = (ushort)in[i+2];
961 debug_printf(" line %d %d\n", (int)i+2, (int)0);
962 (out+j+4)[0] = (ushort)in[i+2];
963 (out+j+4)[1] = (ushort)in[0];
964 }
965 }
966 static void translate_tris_uint2uint(
967 const void * _in,
968 unsigned nr,
969 void *_out )
970 {
971 const uint*in = (const uint*)_in;
972 uint *out = (uint*)_out;
973 unsigned i, j;
974 (void)j;
975 for (j = i = 0; j < nr; j+=6, i+=3) {
976 debug_printf(" line %d %d\n", (int)i, (int)i+1);
977 (out+j)[0] = (uint)in[i];
978 (out+j)[1] = (uint)in[i+1];
979 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
980 (out+j+2)[0] = (uint)in[i+1];
981 (out+j+2)[1] = (uint)in[i+2];
982 debug_printf(" line %d %d\n", (int)i+2, (int)i);
983 (out+j+4)[0] = (uint)in[i+2];
984 (out+j+4)[1] = (uint)in[i];
985 }
986 }
987 static void translate_tristrip_uint2uint(
988 const void * _in,
989 unsigned nr,
990 void *_out )
991 {
992 const uint*in = (const uint*)_in;
993 uint *out = (uint*)_out;
994 unsigned i, j;
995 (void)j;
996 for (j = i = 0; j < nr; j+=6, i++) {
997 debug_printf(" line %d %d\n", (int)i, (int)i+1/*+(i&1)*/);
998 (out+j)[0] = (uint)in[i];
999 (out+j)[1] = (uint)in[i+1/*+(i&1)*/];
1000 debug_printf(" line %d %d\n", (int)i+1/*+(i&1)*/, (int)i+2/*-(i&1)*/);
1001 (out+j+2)[0] = (uint)in[i+1/*+(i&1)*/];
1002 (out+j+2)[1] = (uint)in[i+2/*-(i&1)*/];
1003 debug_printf(" line %d %d\n", (int)i+2/*-(i&1)*/, (int)i);
1004 (out+j+4)[0] = (uint)in[i+2/*-(i&1)*/];
1005 (out+j+4)[1] = (uint)in[i];
1006 }
1007 }
1008 static void translate_trifan_uint2uint(
1009 const void * _in,
1010 unsigned nr,
1011 void *_out )
1012 {
1013 const uint*in = (const uint*)_in;
1014 uint *out = (uint*)_out;
1015 unsigned i, j;
1016 (void)j;
1017 for (j = i = 0; j < nr; j+=6, i++) {
1018 debug_printf(" line %d %d\n", (int)0, (int)i+1);
1019 (out+j)[0] = (uint)in[0];
1020 (out+j)[1] = (uint)in[i+1];
1021 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
1022 (out+j+2)[0] = (uint)in[i+1];
1023 (out+j+2)[1] = (uint)in[i+2];
1024 debug_printf(" line %d %d\n", (int)i+2, (int)0);
1025 (out+j+4)[0] = (uint)in[i+2];
1026 (out+j+4)[1] = (uint)in[0];
1027 }
1028 }
1029 static void translate_quads_uint2uint(
1030 const void * _in,
1031 unsigned nr,
1032 void *_out )
1033 {
1034 const uint*in = (const uint*)_in;
1035 uint *out = (uint*)_out;
1036 unsigned i, j;
1037 (void)j;
1038 for (j = i = 0; j < nr; j+=8, i+=4) {
1039 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
1040 (out+j)[0] = (uint)in[i+0];
1041 (out+j)[1] = (uint)in[i+1];
1042 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
1043 (out+j+2)[0] = (uint)in[i+1];
1044 (out+j+2)[1] = (uint)in[i+2];
1045 debug_printf(" line %d %d\n", (int)i+2, (int)i+3);
1046 (out+j+4)[0] = (uint)in[i+2];
1047 (out+j+4)[1] = (uint)in[i+3];
1048 debug_printf(" line %d %d\n", (int)i+3, (int)i+0);
1049 (out+j+6)[0] = (uint)in[i+3];
1050 (out+j+6)[1] = (uint)in[i+0];
1051 }
1052 }
1053 static void translate_quadstrip_uint2uint(
1054 const void * _in,
1055 unsigned nr,
1056 void *_out )
1057 {
1058 const uint*in = (const uint*)_in;
1059 uint *out = (uint*)_out;
1060 unsigned i, j;
1061 (void)j;
1062 for (j = i = 0; j < nr; j+=8, i+=2) {
1063 debug_printf(" line %d %d\n", (int)i+2, (int)i+0);
1064 (out+j)[0] = (uint)in[i+2];
1065 (out+j)[1] = (uint)in[i+0];
1066 debug_printf(" line %d %d\n", (int)i+0, (int)i+1);
1067 (out+j+2)[0] = (uint)in[i+0];
1068 (out+j+2)[1] = (uint)in[i+1];
1069 debug_printf(" line %d %d\n", (int)i+1, (int)i+3);
1070 (out+j+4)[0] = (uint)in[i+1];
1071 (out+j+4)[1] = (uint)in[i+3];
1072 debug_printf(" line %d %d\n", (int)i+3, (int)i+2);
1073 (out+j+6)[0] = (uint)in[i+3];
1074 (out+j+6)[1] = (uint)in[i+2];
1075 }
1076 }
1077 static void translate_polygon_uint2uint(
1078 const void * _in,
1079 unsigned nr,
1080 void *_out )
1081 {
1082 const uint*in = (const uint*)_in;
1083 uint *out = (uint*)_out;
1084 unsigned i, j;
1085 (void)j;
1086 for (j = i = 0; j < nr; j+=6, i++) {
1087 debug_printf(" line %d %d\n", (int)0, (int)i+1);
1088 (out+j)[0] = (uint)in[0];
1089 (out+j)[1] = (uint)in[i+1];
1090 debug_printf(" line %d %d\n", (int)i+1, (int)i+2);
1091 (out+j+2)[0] = (uint)in[i+1];
1092 (out+j+2)[1] = (uint)in[i+2];
1093 debug_printf(" line %d %d\n", (int)i+2, (int)0);
1094 (out+j+4)[0] = (uint)in[i+2];
1095 (out+j+4)[1] = (uint)in[0];
1096 }
1097 }
1098 void u_unfilled_init( void )
1099 {
1100 static int firsttime = 1;
1101 if (!firsttime) return;
1102 firsttime = 0;
1103 generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLES] = generate_tris_ushort;
1104 generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_ushort;
1105 generate_line[OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_ushort;
1106 generate_line[OUT_USHORT][PIPE_PRIM_QUADS] = generate_quads_ushort;
1107 generate_line[OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_ushort;
1108 generate_line[OUT_USHORT][PIPE_PRIM_POLYGON] = generate_polygon_ushort;
1109 generate_line[OUT_UINT][PIPE_PRIM_TRIANGLES] = generate_tris_uint;
1110 generate_line[OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = generate_trifan_uint;
1111 generate_line[OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = generate_tristrip_uint;
1112 generate_line[OUT_UINT][PIPE_PRIM_QUADS] = generate_quads_uint;
1113 generate_line[OUT_UINT][PIPE_PRIM_QUAD_STRIP] = generate_quadstrip_uint;
1114 generate_line[OUT_UINT][PIPE_PRIM_POLYGON] = generate_polygon_uint;
1115 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2ushort;
1116 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2ushort;
1117 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2ushort;
1118 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_ubyte2ushort;
1119 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2ushort;
1120 translate_line[IN_UBYTE][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2ushort;
1121 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_ubyte2uint;
1122 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ubyte2uint;
1123 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ubyte2uint;
1124 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_ubyte2uint;
1125 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ubyte2uint;
1126 translate_line[IN_UBYTE][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_ubyte2uint;
1127 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2ushort;
1128 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2ushort;
1129 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2ushort;
1130 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_ushort2ushort;
1131 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2ushort;
1132 translate_line[IN_USHORT][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_ushort2ushort;
1133 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_ushort2uint;
1134 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_ushort2uint;
1135 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_ushort2uint;
1136 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_ushort2uint;
1137 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_ushort2uint;
1138 translate_line[IN_USHORT][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_ushort2uint;
1139 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLES] = translate_tris_uint2ushort;
1140 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2ushort;
1141 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2ushort;
1142 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_QUADS] = translate_quads_uint2ushort;
1143 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2ushort;
1144 translate_line[IN_UINT][OUT_USHORT][PIPE_PRIM_POLYGON] = translate_polygon_uint2ushort;
1145 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLES] = translate_tris_uint2uint;
1146 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLE_FAN] = translate_trifan_uint2uint;
1147 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_TRIANGLE_STRIP] = translate_tristrip_uint2uint;
1148 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_QUADS] = translate_quads_uint2uint;
1149 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_QUAD_STRIP] = translate_quadstrip_uint2uint;
1150 translate_line[IN_UINT][OUT_UINT][PIPE_PRIM_POLYGON] = translate_polygon_uint2uint;
1151 }
1152 #include "indices/u_unfilled_indices.c"