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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user