Front-ends GLSL/HLSL: Fix initializer lists for structs of one member.
Single member structs initialized with an initializer list had an incorrect argument for constructor emulation.
This commit is contained in:
parent
96e9f47cbb
commit
ff13213547
8 changed files with 567 additions and 331 deletions
|
|
@ -5145,8 +5145,14 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// now that the subtree is processed, process this node
|
||||
return addConstructor(loc, initList, type);
|
||||
// Now that the subtree is processed, process this node as if the
|
||||
// initializer list is a set of arguments to a constructor.
|
||||
TIntermNode* emulatedConstructorArguments;
|
||||
if (initList->getSequence().size() == 1)
|
||||
emulatedConstructorArguments = initList->getSequence()[0];
|
||||
else
|
||||
emulatedConstructorArguments = initList;
|
||||
return addConstructor(loc, emulatedConstructorArguments, type);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue