SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
2.02k
stars
557
forks
source link
[MSL] Incorrect identifier generated for local variable of user-defined type #2128
Closed
varunk08 closed 1 year ago
The following is the definition of a struct type in the MSL is generated from SPV using spirv-cross
However in the function body which has a local variable of this type there is an identifier name mismatch:
Notice in
out.m_14_v_color = _14.v_color;
the "v" prefix is missing. This causes the MSL compiler to throw an undeclared identifier error.If I remove the addition of the "v" prefix in spirv_msl.cpp then the compilation works fine.
set_name(arg_id, ensure_valid_name(to_name(arg_id), "v"));
to
set_name(arg_id, to_name(arg_id));
Any idea why incorrect identifier is being generated after the local variable declaration?