MSL: Make sure we fix up the output position.

If a stage takes the position as both an input and an output (i.e. a
tessellation shader or a geometry shader), then we could wind up fixing
up the input position by mistake. Ensure that doesn't happen, by only
setting the `qual_pos_var_name` variable from the output position.
This commit is contained in:
Chip Davis 2019-02-22 15:26:00 -06:00
parent 5dde82654c
commit f3267db1d8

View File

@ -1165,7 +1165,7 @@ void CompilerMSL::add_plain_variable_to_interface_block(StorageClass storage, co
if (is_builtin)
{
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin);
if (builtin == BuiltInPosition)
if (builtin == BuiltInPosition && storage == StorageClassOutput)
qual_pos_var_name = qual_var_name;
}
@ -1572,7 +1572,7 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
if (is_builtin)
{
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, builtin);
if (builtin == BuiltInPosition)
if (builtin == BuiltInPosition && storage == StorageClassOutput)
qual_pos_var_name = qual_var_name;
}