summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/indices/u_unfilled_gen.py
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2013-10-25 15:22:06 -0400
committerRob Clark <[email protected]>2013-10-29 16:49:43 -0400
commit28f3f8d413f6bf29f051d54479d9ae90bb16a55e (patch)
tree723e5489d29c154bf2e6465d1af8701211823307 /src/gallium/auxiliary/indices/u_unfilled_gen.py
parent5127436a4a1a7fb56acbd2934318d3053f37af68 (diff)
gallium/auxiliary/indices: add start param
Add 'start' parameter to generator/translator. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/indices/u_unfilled_gen.py')
-rw-r--r--src/gallium/auxiliary/indices/u_unfilled_gen.py13
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()