mirror of
https://github.com/KhronosGroup/glslang
synced 2024-09-19 12:19:53 +00:00
Branch out of relaxed rules on opaque arguments declared at top-level (#3558)
This commit is contained in:
parent
8c0199c4fd
commit
0015dc9345
@ -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,7 +508,10 @@ function_call_header_with_parameters
|
||||
&& $3->getType().containsOpaque())
|
||||
{
|
||||
TIntermNode* remappedNode = parseContext.vkRelaxedRemapFunctionArgument($2.loc, $1.function, $3);
|
||||
$$.intermNode = parseContext.intermediate.mergeAggregate($1.intermNode, remappedNode, $2.loc);
|
||||
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;
|
||||
}
|
||||
else
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user