Implement relaxed rule for opaque struct members

This commit is contained in:
Samuel Bourasseau 2023-11-29 01:19:02 +01:00 committed by GitHub
parent a3069e1df4
commit c59b876ca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 2787 additions and 2187 deletions

View file

@ -722,6 +722,24 @@ void TParseContextBase::finish()
if (parsingBuiltins)
return;
for (const TString& relaxedSymbol : relaxedSymbols)
{
TSymbol* symbol = symbolTable.find(relaxedSymbol);
TType& type = symbol->getWritableType();
for (const TTypeLoc& typeLoc : *type.getStruct())
{
if (typeLoc.type->isOpaque())
{
typeLoc.type->getSampler() = TSampler{};
typeLoc.type->setBasicType(EbtInt);
TString fieldName("/*");
fieldName.append(typeLoc.type->getFieldName());
fieldName.append("*/");
typeLoc.type->setFieldName(fieldName);
}
}
}
// Transfer the linkage symbols to AST nodes, preserving order.
TIntermAggregate* linkage = new TIntermAggregate;
for (auto i = linkageSymbols.begin(); i != linkageSymbols.end(); ++i)