diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-02-05 16:04:13 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-02-05 16:04:38 +0000 |
commit | 96fb896c3916053c5b3b67c4f51911d718aef2d4 (patch) | |
tree | 70d424a9cc5ccab3a4f8ef1d68822f0ab203ff98 /src/gallium/auxiliary/indices/u_indices_gen.py | |
parent | 3120894c6d33a26cda642246344e8945db200ac2 (diff) |
indices: quad fixes
Diffstat (limited to 'src/gallium/auxiliary/indices/u_indices_gen.py')
-rw-r--r-- | src/gallium/auxiliary/indices/u_indices_gen.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py index 397eea306b..40b047bb58 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.py +++ b/src/gallium/auxiliary/indices/u_indices_gen.py @@ -139,6 +139,9 @@ def do_tri( intype, outtype, ptr, v0, v1, v2, inpv, outpv ): else: tri( intype, outtype, ptr, v2, v0, v1 ) +def do_quad( intype, outtype, ptr, v0, v1, v2, v3, inpv, outpv ): + do_tri( intype, outtype, ptr+'+0', v0, v1, v3, inpv, outpv ); + do_tri( intype, outtype, ptr+'+3', v1, v2, v3, inpv, outpv ); def name(intype, outtype, inpv, outpv, prim): if intype == GENERATE: @@ -234,8 +237,7 @@ def polygon(intype, outtype, inpv, outpv): def quads(intype, outtype, inpv, outpv): preamble(intype, outtype, inpv, outpv, prim='quads') print ' for (j = i = 0; j < nr; j+=6, i+=4) { ' - do_tri( intype, outtype, 'out+j+0', 'i+0', 'i+1', 'i+3', inpv, outpv ); - do_tri( intype, outtype, 'out+j+3', 'i+1', 'i+2', 'i+3', inpv, outpv ); + do_quad( intype, outtype, 'out+j', 'i+0', 'i+1', 'i+2', 'i+3', inpv, outpv ); print ' }' postamble() @@ -243,8 +245,7 @@ def quads(intype, outtype, inpv, outpv): def quadstrip(intype, outtype, inpv, outpv): preamble(intype, outtype, inpv, outpv, prim='quadstrip') print ' for (j = i = 0; j < nr; j+=6, i+=2) { ' - do_tri( intype, outtype, 'out+j+0', 'i+0', 'i+1', 'i+3', inpv, outpv ); - do_tri( intype, outtype, 'out+j+3', 'i+1', 'i+2', 'i+3', inpv, outpv ); + do_quad( intype, outtype, 'out+j', 'i+2', 'i+0', 'i+1', 'i+3', inpv, outpv ); print ' }' postamble() |