spirv: Handle instruction aliases in vtn_gather_types
[mesa.git] / src / compiler / spirv / vtn_gather_types_c.py
index 7b42e95cc35d4a44e0ba07538a36f64a9f46b3bf..d30a91d2b7a41271ddcd02ea80f8582e2d03021b 100644 (file)
@@ -29,7 +29,13 @@ from sys import stdout
 from mako.template import Template
 
 def find_result_types(spirv):
+    seen = set()
     for inst in spirv['instructions']:
+        # Handle aliases by choosing the first one in the grammar.
+        if inst['opcode'] in seen:
+            continue
+        seen.add(inst['opcode'])
+
         name = inst['opname']
 
         if 'operands' not in inst: