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:
parent
f766ee96f5
commit
4142fead74
@ -1177,10 +1177,13 @@ void HlslParseContext::flatten(const TVariable& variable, bool linkage, bool arr
|
|||||||
if (type.isBuiltIn() && !type.isStruct())
|
if (type.isBuiltIn() && !type.isStruct())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(),
|
auto entry = flattenMap.insert(std::make_pair(variable.getUniqueId(),
|
||||||
TFlattenData(type.getQualifier().layoutBinding,
|
TFlattenData(type.getQualifier().layoutBinding,
|
||||||
type.getQualifier().layoutLocation)));
|
type.getQualifier().layoutLocation)));
|
||||||
|
|
||||||
|
if (type.isStruct() && type.getStruct()->size()==0)
|
||||||
|
return;
|
||||||
// if flattening arrayed io struct, array each member of dereferenced type
|
// if flattening arrayed io struct, array each member of dereferenced type
|
||||||
if (arrayed) {
|
if (arrayed) {
|
||||||
const TType dereferencedType(type, 0);
|
const TType dereferencedType(type, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user