gallium/indices: implement prim-restart for triangle fans
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 22 Jun 2020 18:13:45 +0000 (20:13 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 Aug 2020 12:12:27 +0000 (12:12 +0000)
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

src/gallium/auxiliary/indices/u_indices_gen.py

index d392f5c65bd49119feff3532b983cc72cd0ec6c8..2d08072c41aab233b195c6dc4d15a45d2f94ea27 100644 (file)
@@ -288,6 +288,12 @@ def tristrip(intype, outtype, inpv, outpv, pr):
 def trifan(intype, outtype, inpv, outpv, pr):
     preamble(intype, outtype, inpv, outpv, pr, prim='trifan')
     print('  for (i = start, j = 0; j < out_nr; j+=3, i++) { ')
+
+    if pr == PRENABLE:
+        def close_func(index):
+            print('         start = i;')
+        prim_restart(3, 3, 1, close_func)
+
     do_tri( intype, outtype, 'out+j',  'start', 'i+1', 'i+2', inpv, outpv );
     print('   }')
     postamble()