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:
@@ -3725,8 +3725,14 @@ TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, co
|
||||
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);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user