From 6907ea5c8f83712f40fbc7713de4f4bb656c6c35 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Tue, 6 May 2025 00:27:00 +0000 Subject: Add a new capability hlsl_2018 that avoid using select/and/or (#7003) Co-authored-by: Yong He --- source/slang/slang-emit-hlsl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-emit-hlsl.cpp') diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index 2d963866d..3813cf9cb 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -826,6 +826,9 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu auto targetProfile = getTargetProgram()->getOptionSet().getProfile(); if (targetProfile.getVersion() < ProfileVersion::DX_6_0) return false; + auto targetCaps = getTargetReq()->getTargetCaps(); + if (targetCaps.implies(CapabilityAtom::hlsl_2018)) + return false; if (as(inst->getDataType())) return false; @@ -851,6 +854,9 @@ bool HLSLSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOu auto targetProfile = getTargetProgram()->getOptionSet().getProfile(); if (targetProfile.getVersion() < ProfileVersion::DX_6_0) return false; + auto targetCaps = getTargetReq()->getTargetCaps(); + if (targetCaps.implies(CapabilityAtom::hlsl_2018)) + return false; if (as(inst->getDataType())) return false; -- cgit v1.2.3