Branch out of relaxed rules on opaque arguments declared at top-level (#3558)
This commit is contained in:
parent
8c0199c4fd
commit
0015dc9345
4 changed files with 1429 additions and 1411 deletions
|
|
@ -7637,6 +7637,7 @@ struct AccessChainTraverser : public TIntermTraverser {
|
|||
{}
|
||||
|
||||
TString path = "";
|
||||
TStorageQualifier topLevelStorageQualifier = TStorageQualifier::EvqLast;
|
||||
|
||||
bool visitBinary(TVisit, TIntermBinary* binary) override {
|
||||
if (binary->getOp() == EOpIndexDirectStruct)
|
||||
|
|
@ -7667,6 +7668,8 @@ struct AccessChainTraverser : public TIntermTraverser {
|
|||
}
|
||||
|
||||
void visitSymbol(TIntermSymbol* symbol) override {
|
||||
if (symbol->getType().isOpaque())
|
||||
topLevelStorageQualifier = symbol->getQualifier().storage;
|
||||
if (!IsAnonymous(symbol->getName()))
|
||||
path.append(symbol->getName());
|
||||
}
|
||||
|
|
@ -7677,6 +7680,15 @@ TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc
|
|||
AccessChainTraverser accessChainTraverser{};
|
||||
intermTyped->traverse(&accessChainTraverser);
|
||||
|
||||
if (accessChainTraverser.topLevelStorageQualifier == TStorageQualifier::EvqUniform)
|
||||
{
|
||||
TParameter param = { 0, new TType, {} };
|
||||
param.type->shallowCopy(intermTyped->getType());
|
||||
|
||||
function->addParameter(param);
|
||||
return intermTyped;
|
||||
}
|
||||
|
||||
TParameter param = { NewPoolTString(accessChainTraverser.path.c_str()), new TType, {} };
|
||||
param.type->shallowCopy(intermTyped->getType());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue