WIP: HLSL: preserve empty structures after splitting

This commit is contained in:
steve-lunarg
2017-03-09 19:10:57 -07:00
parent 6e1d50a7a2
commit 4198b8bfc4
8 changed files with 72 additions and 20 deletions

View File

@@ -1444,12 +1444,7 @@ void HlslParseContext::assignLocations(TVariable& variable)
assignLocation(**member);
} else if (wasSplit(variable.getUniqueId())) {
TVariable* splitIoVar = getSplitIoVar(&variable);
const TTypeList* structure = splitIoVar->getType().getStruct();
// Struct splitting can produce empty structures if the only members of the
// struct were builtin interstage IO types. Only assign locations if it
// isn't a struct, or is a non-empty struct.
if (structure == nullptr || !structure->empty())
assignLocation(*splitIoVar);
assignLocation(*splitIoVar);
} else {
assignLocation(variable);
}