[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)
Deric C. via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 14:49:39 PDT 2025
================
@@ -101,6 +101,16 @@ constexpr vector<T, N> smoothstep_vec_impl(vector<T, N> Min, vector<T, N> Max,
#endif
}
+template <typename T> constexpr vector<T, 4> lit_impl(T NDotL, T NDotH, T M) {
+ bool DiffuseCond = NDotL < 0;
+ T Diffuse = select<T>(DiffuseCond, 0, NDotL);
+ vector<T, 4> Result = {1, Diffuse, 0, 1};
+ bool SpecularCond = or (DiffuseCond, (NDotH < 0));
----------------
Icohedron wrote:
I had a similar issue when implementing the `and` intrinsic (#127098). Justin filed an issue for it (#127851) and in the meantime I manually fixed the spacing. I don't recall the PR code format check complaining about it.
https://github.com/llvm/llvm-project/pull/134171
More information about the cfe-commits
mailing list