[clang] [llvm] [HLSL] Implement the `faceforward` intrinsic (PR #135878)

Kaitlin Peng via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 16 13:46:16 PDT 2025


================
@@ -214,6 +214,53 @@ const inline double4 dst(double4 Src0, double4 Src1) {
   return __detail::dst_impl(Src0, Src1);
 }
 
+//===----------------------------------------------------------------------===//
+// faceforward builtin
+//===----------------------------------------------------------------------===//
+
+/// \fn T faceforward(T N, T I, T Ng)
+/// \brief Flips the surface-normal (if needed) to face in a direction opposite
+/// to \a I. Returns the result in \a N.
----------------
kmpeng wrote:

Ah yeah, that's makes it much more clear. Code updated, thanks!

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


More information about the cfe-commits mailing list