MSL: append entry point args to local variable names to avoid conflicts

This commit is contained in:
xndcn 2022-02-24 22:52:21 +08:00
parent 188dc8b13c
commit 1b5c406a3d

View File

@ -9335,6 +9335,9 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &)
else
decl += entry_point_args_classic(!func.arguments.empty());
// append entry point args to avoid conflicts in local variable names.
local_variable_names.insert(resource_names.begin(), resource_names.end());
// If entry point function has variables that require early declaration,
// ensure they each have an empty initializer, creating one if needed.
// This is done at this late stage because the initialization expression