Fix #2329: don't use invalid initializers.

This commit is contained in:
John Kessenich
2020-07-13 00:35:58 -06:00
parent 206886948a
commit 4e13c90944
6 changed files with 176 additions and 2 deletions

View File

@@ -2722,7 +2722,7 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu
setPrecision(id, precision);
} else {
Id lValue = NoResult;
if (spvVersion >= Spv_1_4) {
if (spvVersion >= Spv_1_4 && isValidInitializer(accessChain.base)) {
// make a new function variable for this r-value, using an initializer,
// and mark it as NonWritable so that downstream it can be detected as a lookup
// table