HLSL: Build IO types bottom up, as parsed, and cache the original (IO).

Previously, this was done recursively, per object, and the nonIO version
was cached. This reverses both those approaches.
This commit is contained in:
John Kessenich
2017-02-03 17:57:55 -07:00
parent 88c4464df5
commit 727b374fd3
7 changed files with 295 additions and 324 deletions

View File

@@ -1708,14 +1708,7 @@ bool HlslGrammar::acceptStruct(TType& type)
new(&type) TType(typeList, structName, postDeclQualifier); // sets EbtBlock
}
// If it was named, which means the type can be reused later, add
// it to the symbol table. (Unless it's a block, in which
// case the name is not a type.)
if (type.getBasicType() != EbtBlock && structName.size() > 0) {
TVariable* userTypeDef = new TVariable(&structName, type, true);
if (! parseContext.symbolTable.insert(*userTypeDef))
parseContext.error(token.loc, "redefinition", structName.c_str(), "struct");
}
parseContext.declareStruct(token.loc, structName, type);
return true;
}