Skip to content

Commit

Permalink
fix crash in HLSL frontend
Browse files Browse the repository at this point in the history
fix crash, when converting HLSL return of hull shader into spirv/glsl like arrayed output.

fix KhronosGroup#2914
  • Loading branch information
Try authored and kd-11 committed Dec 11, 2023
1 parent f36ffb9 commit 7536f56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions glslang/HLSL/hlslParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7536f56

Please sign in to comment.