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

Sarah Spall via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 11:33:31 PDT 2025


================
@@ -21,3 +24,18 @@ float test_int_scalar_inputs(int p0, int p1, int p2) {
   return __builtin_spirv_refract(p0, p1, p2);
   //  expected-error at -1 {{1st argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'int')}}
 }
+
+float test_float_and_half_inputs(float2 p0, half2 p1, float p2) {
+  return __builtin_spirv_refract(p0, p1, p2);
+  //  expected-error at -1 {{2nd argument must be a scalar or vector of 16 or 32 bit floating-point types (was 'half2' (vector of 2 'half' values))}}
----------------
spall wrote:

This is not the error message I would expect to see here.  I would expect to see an error message like
```
first two arguments to __builtin_spirv_refract must have the same type."
```

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


More information about the llvm-commits mailing list