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
|
|
@ -243,7 +243,7 @@ gl_FragCoord origin is upper left
|
|||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 texture ( global highp 4-component vector of float)
|
||||
0:74 'structUniform.t0' ( uniform highp sampler2D)
|
||||
0:? 'structUniform.t0' ( uniform highp sampler2D)
|
||||
0:74 Constant:
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
|
|
@ -576,7 +576,7 @@ gl_FragCoord origin is upper left
|
|||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
0:74 texture ( global highp 4-component vector of float)
|
||||
0:74 'structUniform.t0' ( uniform highp sampler2D)
|
||||
0:? 'structUniform.t0' ( uniform highp sampler2D)
|
||||
0:74 Constant:
|
||||
0:74 0.000000
|
||||
0:74 0.000000
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
|
|
@ -508,6 +508,9 @@ function_call_header_with_parameters
|
|||
&& $3->getType().containsOpaque())
|
||||
{
|
||||
TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument($2.loc, $1.function, $3);
|
||||
if (remappedNode == $3)
|
||||
$$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc);
|
||||
else
|
||||
$$.intermNode = parseContext.intermediate.mergeAggregate($1.intermNode, remappedNode, $2.loc);
|
||||
$$.function = $1.function;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue