HLSL: fix crash on empty struct return from entry point

This commit is contained in:
steve-lunarg
2017-03-24 08:56:37 -06:00
parent 19ea56899c
commit d8e34c5119
6 changed files with 231 additions and 0 deletions

View File

@@ -2100,6 +2100,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
int memberL = 0;
int memberR = 0;
// Handle empty structure assignment
if (int(membersL.size()) == 0 && int(membersR.size()) == 0)
assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, right, loc), loc);
for (int member = 0; member < int(membersL.size()); ++member) {
const TType& typeL = *membersL[member].type;
const TType& typeR = *membersR[member].type;