Decorate accesschain operand for nonuniform UBO loads

This is conservative and still also decorates the loaded value.
This commit is contained in:
Jeff Bolz 2020-03-09 11:31:15 -05:00
parent 39ffdaf2ab
commit b57af2f5ad
9 changed files with 110 additions and 3 deletions

View file

@ -2731,7 +2731,13 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu
}
// load through the access chain
id = createLoad(collapseAccessChain(), memoryAccess, scope, alignment);
id = collapseAccessChain();
// Apply nonuniform both to the access chain and the loaded value.
// Buffer accesses need the access chain decorated, and this is where
// loaded image types get decorated. TODO: This should maybe move to
// createImageTextureFunctionCall.
addDecoration(id, nonUniform);
id = createLoad(id, memoryAccess, scope, alignment);
setPrecision(id, precision);
addDecoration(id, nonUniform);
}