From: Caio Marcelo de Oliveira Filho Date: Wed, 22 Apr 2020 04:54:56 +0000 (-0700) Subject: spirv: Handle instruction aliases in vtn_gather_types X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5620c3efd85f42a1301d63d55195704ee8365e5e;p=mesa.git spirv: Handle instruction aliases in vtn_gather_types Same solution as done in spirv_info generation. Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/compiler/spirv/vtn_gather_types_c.py b/src/compiler/spirv/vtn_gather_types_c.py index 7b42e95cc35..d30a91d2b7a 100644 --- a/src/compiler/spirv/vtn_gather_types_c.py +++ b/src/compiler/spirv/vtn_gather_types_c.py @@ -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: