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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 10:42:00 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,
----------------
raoanag wrote:

We want to support vector of size 1, which is implicitly converted to scalar.
Also [HLSL_FIXED_VECTOR](https://github.com/raoanag/llvm-project/blob/6504c96b1d865c69888a2a17aa8fe479987c00f0/clang/lib/Headers/hlsl/hlsl_detail.h#L49) only supports Vector of N > 1.

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


More information about the llvm-commits mailing list