[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)
Deric C. via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 7 09:45:30 PDT 2025
================
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); }
_DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
_DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
+//===----------------------------------------------------------------------===//
+// lit builtins overloads
+//===----------------------------------------------------------------------===//
+
+template <typename T>
+constexpr __detail::enable_if_t<__detail::is_arithmetic<T>::Value &&
+ (__detail::is_same<double, T>::value ||
----------------
Icohedron wrote:
I don't understand why `lit(bool,bool,bool)` isn't ambiguous.
C++ doesn't have half types, but defining two functions `lit(float,float,float)` and `lit(double,double,double)` and then calling `lit(bool,bool,bool)` results in a compilation error `error: call to 'lit' is ambiguous` as seen here: https://godbolt.org/z/Y3ThTfEs9
Is there special case handling for overload resolution implemented for HLSL?
https://github.com/llvm/llvm-project/pull/134171
More information about the cfe-commits
mailing list