[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 17 11:26:06 PDT 2025
================
@@ -126,6 +126,24 @@ template <typename T> constexpr vector<T, 4> lit_impl(T NDotL, T NDotH, T M) {
return Result;
}
+template <typename T> constexpr T faceforward_impl(T N, T I, T Ng) {
----------------
farzonl wrote:
So in cases like length and distance I know why we had a scalar and vector version of the implementation function.
In those two cases the return type was different than the argument types. In other cases like reflect it also made sense to do two seperate functions because the scalar case did not call the spirv builtin. In this case the return and argument types are the same and both the vector ans scalar cases call the spirv builtin so why do we need two seperate templatized functions?
https://github.com/llvm/llvm-project/pull/135878
More information about the llvm-commits
mailing list