From 9a23a9aab3721828526c921db1e779008e133e8f Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 8 Jun 2024 05:12:49 -0700 Subject: SPIRV `Block` decoration fixes. (#4303) * SPIRV `Block` decoration fixes. - SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them. - Also fixes duplication of OpName. - SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code. * Convert failing cross-compile tests to filecheck. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> --- source/slang/slang-ir-specialize-target-switch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ir-specialize-target-switch.cpp') diff --git a/source/slang/slang-ir-specialize-target-switch.cpp b/source/slang/slang-ir-specialize-target-switch.cpp index fac1dd484..46ea51192 100644 --- a/source/slang/slang-ir-specialize-target-switch.cpp +++ b/source/slang/slang-ir-specialize-target-switch.cpp @@ -31,7 +31,9 @@ namespace Slang bool isBetterForTarget = capSet.isBetterForTarget(bestCapSet, target->getTargetCaps(), isEqual); if (isBetterForTarget) { - bool targetImpliesCapSet = (target->getTargetCaps().implies(capSet, true) || capSet.isEmpty()); + CapabilitySet joinedCapSet = capSet; + joinedCapSet.join(target->getTargetCaps()); + bool targetImpliesCapSet = target->getTargetCaps().implies(joinedCapSet, true); if (targetImpliesCapSet) { // Now check if bestCapSet contains targetCaps. If it does not then this is an invalid target -- cgit v1.2.3