fix crash in HLSL frontend

fix crash, when converting HLSL return of hull shader into spirv/glsl like arrayed output.

fix #2914
This commit is contained in:
Try 2022-03-26 16:31:50 +01:00 committed by arcady-lunarg
parent f766ee96f5
commit 4142fead74

View File

@ -1177,10 +1177,13 @@ void HlslParseContext::flatten(const TVariable& variable, bool linkage, bool arr
if (type.isBuiltIn() && !type.isStruct())
return;
auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(),
TFlattenData(type.getQualifier().layoutBinding,
type.getQualifier().layoutLocation)));
if (type.isStruct() && type.getStruct()->size()==0)
return;
// if flattening arrayed io struct, array each member of dereferenced type
if (arrayed) {
const TType dereferencedType(type, 0);