From 7536f5670b16918ae53e9de38409f3de93e581cd Mon Sep 17 00:00:00 2001 From: Try Date: Sat, 26 Mar 2022 16:31:50 +0100 Subject: [PATCH] fix crash in HLSL frontend fix crash, when converting HLSL return of hull shader into spirv/glsl like arrayed output. fix #2914 --- glslang/HLSL/hlslParseHelper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index c711aa02c2..ac0dee50ca 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -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);