diff options
Diffstat (limited to 'src/gallium/auxiliary/indices/u_unfilled_gen.py')
-rw-r--r-- | src/gallium/auxiliary/indices/u_unfilled_gen.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/indices/u_unfilled_gen.py b/src/gallium/auxiliary/indices/u_unfilled_gen.py index 085c47a114a..88649724521 100644 --- a/src/gallium/auxiliary/indices/u_unfilled_gen.py +++ b/src/gallium/auxiliary/indices/u_unfilled_gen.py @@ -127,6 +127,7 @@ def preamble(intype, outtype, prim): print 'static void ' + name( intype, outtype, prim ) + '(' if intype != GENERATE: print ' const void * _in,' + print ' unsigned start,' print ' unsigned nr,' print ' void *_out )' print '{' @@ -142,7 +143,7 @@ def postamble(): def tris(intype, outtype): preamble(intype, outtype, prim='tris') - print ' for (j = i = 0; j < nr; j+=6, i+=3) { ' + print ' for (i = start, j = 0; j < nr; j+=6, i+=3) { ' do_tri( intype, outtype, 'out+j', 'i', 'i+1', 'i+2' ); print ' }' postamble() @@ -150,7 +151,7 @@ def tris(intype, outtype): def tristrip(intype, outtype): preamble(intype, outtype, prim='tristrip') - print ' for (j = i = 0; j < nr; j+=6, i++) { ' + print ' for (i = start, j = 0; j < nr; j+=6, i++) { ' do_tri( intype, outtype, 'out+j', 'i', 'i+1/*+(i&1)*/', 'i+2/*-(i&1)*/' ); print ' }' postamble() @@ -158,7 +159,7 @@ def tristrip(intype, outtype): def trifan(intype, outtype): preamble(intype, outtype, prim='trifan') - print ' for (j = i = 0; j < nr; j+=6, i++) { ' + print ' for (i = start, j = 0; j < nr; j+=6, i++) { ' do_tri( intype, outtype, 'out+j', '0', 'i+1', 'i+2' ); print ' }' postamble() @@ -167,7 +168,7 @@ def trifan(intype, outtype): def polygon(intype, outtype): preamble(intype, outtype, prim='polygon') - print ' for (j = i = 0; j < nr; j+=2, i++) { ' + print ' for (i = start, j = 0; j < nr; j+=2, i++) { ' line( intype, outtype, 'out+j', 'i', '(i+1)%(nr/2)' ) print ' }' postamble() @@ -175,7 +176,7 @@ def polygon(intype, outtype): def quads(intype, outtype): preamble(intype, outtype, prim='quads') - print ' for (j = i = 0; j < nr; j+=8, i+=4) { ' + print ' for (i = start, j = 0; j < nr; j+=8, i+=4) { ' do_quad( intype, outtype, 'out+j', 'i+0', 'i+1', 'i+2', 'i+3' ); print ' }' postamble() @@ -183,7 +184,7 @@ def quads(intype, outtype): def quadstrip(intype, outtype): preamble(intype, outtype, prim='quadstrip') - print ' for (j = i = 0; j < nr; j+=8, i+=2) { ' + print ' for (i = start, j = 0; j < nr; j+=8, i+=2) { ' do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3' ); print ' }' postamble() |