Mesa (master): gallium/indices: implement prim-restart for triangle fans

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 18 12:28:44 UTC 2020


Module: Mesa
Branch: master
Commit: c2e9cd3f773863f5745a7eea1f6f9cec11f84a8a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2e9cd3f773863f5745a7eea1f6f9cec11f84a8a

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Jun 22 20:13:45 2020 +0200

gallium/indices: implement prim-restart for triangle fans

Reviewed-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5976>

---

 src/gallium/auxiliary/indices/u_indices_gen.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py
index d392f5c65bd..2d08072c41a 100644
--- a/src/gallium/auxiliary/indices/u_indices_gen.py
+++ b/src/gallium/auxiliary/indices/u_indices_gen.py
@@ -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()



More information about the mesa-commit mailing list