[clang] [llvm] [HLSL][DXIL] Implement `refract` intrinsic (PR #147342)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 07:58:38 PDT 2025


================
@@ -235,6 +288,30 @@ bool SemaSPIRV::CheckSPIRVBuiltinFunctionCall(const TargetInfo &TI,
     TheCall->setType(RetTy);
     break;
   }
+  case SPIRV::BI__builtin_spirv_refract: {
+    if (SemaRef.checkArgCount(TheCall, 3))
+      return true;
+
+    llvm::function_ref<bool(Sema *, SourceLocation, int, QualType)>
+        ChecksArr[] = {CheckFloatOrHalfRepresentation,
----------------
farzonl wrote:

We will need to open bug tickets for `distance`, `length`, & `reflect`. `smoothstep` and `faceforward` are generating the spirv glsl ext op for scalar cases: https://godbolt.org/z/fYf6zbGc5.



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


More information about the llvm-commits mailing list