From b4d3d3017640581c21b52a12413d3f074ab1c5c1 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 15 May 2025 02:57:47 +0000 Subject: Support the new CoopVec builtins (#7108) **NOTE: This is a breaking change for users who were using POC variant of DXC. In order to keep the compatibility, the users will have to use -capability hlsl_coopvec_poc to their command line. This PR adds a new capability "hlsl_coopvec_poc". When it is used, the HLSL for CoopVec will be emitted for the POC variant of DXC. When it is not used, the HLSL for CoopVec will be emitted for the DXC that officially supports the cooperative vector. --- source/slang/slang.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 67d13c34b..c7f6c920c 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -2347,7 +2347,16 @@ CapabilitySet TargetRequest::getTargetCaps() for (auto atomVal : optionSet.getArray(CompilerOptionName::Capability)) { - auto toAdd = CapabilitySet((CapabilityName)atomVal.intValue); + CapabilitySet toAdd; + switch (atomVal.kind) + { + case CompilerOptionValueKind::Int: + toAdd = CapabilitySet(CapabilityName(atomVal.intValue)); + break; + case CompilerOptionValueKind::String: + toAdd = CapabilitySet(findCapabilityName(atomVal.stringValue.getUnownedSlice())); + break; + } if (isGLSLTarget) targetCap.addSpirvVersionFromOtherAsGlslSpirvVersion(toAdd); -- cgit v1.2.3