[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

Steven Perron via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 17:56:23 PST 2024


================
@@ -1407,6 +1407,15 @@ void addInstrRequirements(const MachineInstr &MI,
       Reqs.addCapability(SPIRV::Capability::SplitBarrierINTEL);
     }
     break;
+  case SPIRV::OpKill: {
+    Reqs.addCapability(SPIRV::Capability::Shader) ;
+  } break;
+  case SPIRV::OpDemoteToHelperInvocation:
+    if (ST.canUseExtension(
+            SPIRV::Extension::SPV_EXT_demote_to_helper_invocation)) {
+      Reqs.addExtension(SPIRV::Extension::SPV_EXT_demote_to_helper_invocation);
----------------
s-perron wrote:

To go with the comment above, you should only add the extension of the spirv version is less than 1.6.

https://github.com/llvm/llvm-project/pull/114588


More information about the cfe-commits mailing list