From aaca2d2b615ce113ae9eff11a6fc01f579471b12 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Mon, 25 Nov 2024 10:15:20 +0200 Subject: wgsl: Fix field semantics even if input struct doesn't need flattening (#5642) * wgsl: Fix field semantics even if input struct doesn't need flattening Helps to address issue #5633. * Add test for multiple stage IO locations This verifies part of issue #5633. --- source/slang/slang-ir-wgsl-legalize.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/slang/slang-ir-wgsl-legalize.cpp b/source/slang/slang-ir-wgsl-legalize.cpp index 4d617a169..8eb820b4d 100644 --- a/source/slang/slang-ir-wgsl-legalize.cpp +++ b/source/slang/slang-ir-wgsl-legalize.cpp @@ -145,11 +145,10 @@ struct LegalizeWGSLEntryPointContext structType, mapOldFieldToNewField, semanticInfoToRemove); + // Validate/rearange all semantics which overlap in our flat struct. + fixFieldSemanticsOfFlatStruct(flattenedStruct); if (flattenedStruct != structType) { - // Validate/rearange all semantics which overlap in our flat struct - fixFieldSemanticsOfFlatStruct(flattenedStruct); - // Replace the 'old IRParam type' with a 'new IRParam type' param->setFullType(flattenedStruct); -- cgit v1.2.3