Mesa (master): gallium/aux: reorder vertex attributes in triangle fans according to PV
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 18 12:28:44 UTC 2020
Module: Mesa
Branch: master
Commit: fcc7a1e7b6d6bc149938c1203a55e1ede3517af5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fcc7a1e7b6d6bc149938c1203a55e1ede3517af5
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Tue Jul 14 15:28:00 2020 +0200
gallium/aux: reorder vertex attributes in triangle fans according to PV
With triangle fans when "first vertex convention" is active the
provoking vertex is actually the second vertex so that the different
triangle can have different colors with flat shading. Take this into
account when re-ordering the vertex indices (as proposed by Erik)
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund 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, 5 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py
index 2d08072c41a..3c64bb213e4 100644
--- a/src/gallium/auxiliary/indices/u_indices_gen.py
+++ b/src/gallium/auxiliary/indices/u_indices_gen.py
@@ -294,7 +294,11 @@ def trifan(intype, outtype, inpv, outpv, pr):
print(' start = i;')
prim_restart(3, 3, 1, close_func)
- do_tri( intype, outtype, 'out+j', 'start', 'i+1', 'i+2', inpv, outpv );
+ if inpv == FIRST:
+ do_tri( intype, outtype, 'out+j', 'i+1', 'i+2', 'start', inpv, outpv );
+ else:
+ do_tri( intype, outtype, 'out+j', 'start', 'i+1', 'i+2', inpv, outpv );
+
print(' }')
postamble()
More information about the mesa-commit
mailing list