spirv: Handle instruction aliases in vtn_gather_types

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>
This commit is contained in:
Caio Marcelo de Oliveira Filho 2020-04-21 21:54:56 -07:00 committed by Marge Bot
parent 8cba1a13fa
commit 5620c3efd8
1 changed files with 6 additions and 0 deletions

View 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: