MSL: Fix setting SPIRVCrossDecorationInterpolantComponentExpr decoration.

When setting SPIRVCrossDecorationInterpolantComponentExpr decoration, take
into consideration a possible array of vectors in an access chain, and don't
apply the decoration until we traverse through the array into the vector itself.
This commit is contained in:
Bill Hollings 2021-07-12 14:52:07 -04:00
parent 1ae2b58f19
commit 3e04eee491

View File

@ -7449,7 +7449,7 @@ void CompilerMSL::fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t
// for that getting the base index.
for (uint32_t i = 3; i < length; ++i)
{
if (is_vector(*type) && is_scalar(result_type))
if (is_vector(*type) && !is_array(*type) && is_scalar(result_type))
{
// We don't want to combine the next index. Actually, we need to save it
// so we know to apply a swizzle to the result of the interpolation.