Same solution as done in spirv_info generation.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4682>
from mako.template import Template
def find_result_types(spirv):
from mako.template import Template
def find_result_types(spirv):
for inst in spirv['instructions']:
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:
name = inst['opname']
if 'operands' not in inst: