@@ -605,5 +605,81 @@ smoothstep(__detail::HLSL_FIXED_VECTOR<float, N> Min,
605605 return __detail::smoothstep_vec_impl (Min, Max, X);
606606}
607607
608+ // ===----------------------------------------------------------------------===//
609+ // ddx_coarse builtin
610+ // ===----------------------------------------------------------------------===//
611+
612+ // / \fn T ddx_coarse(T value)
613+ // / \brief Computes a low precision partial derivative with respect to the
614+ // / screen-space x-coordinate.
615+ // / \param value The input value.
616+ // /
617+ // / The return value is a floating point scalar or vector containing the low
618+ // / prevision partial derivative of the input value.
619+
620+ template <typename T>
621+ const inline __detail::enable_if_t <
622+ __detail::is_arithmetic<T>::Value && __detail::is_same<half, T>::value, T>
623+ ddx_coarse (T value) {
624+ return __detail::ddx_coarse_impl (value);
625+ }
626+
627+ template <typename T>
628+ const inline __detail::enable_if_t <
629+ __detail::is_arithmetic<T>::Value && __detail::is_same<float , T>::value, T>
630+ ddx_coarse (T value) {
631+ return __detail::ddx_coarse_impl (value);
632+ }
633+
634+ template <int L>
635+ const inline __detail::HLSL_FIXED_VECTOR<half, L>
636+ ddx_coarse (__detail::HLSL_FIXED_VECTOR<half, L> value) {
637+ return __detail::ddx_coarse_impl (value);
638+ }
639+
640+ template <int L>
641+ const inline __detail::HLSL_FIXED_VECTOR<float , L>
642+ ddx_coarse (__detail::HLSL_FIXED_VECTOR<float , L> value) {
643+ return __detail::ddx_coarse_impl (value);
644+ }
645+
646+ // ===----------------------------------------------------------------------===//
647+ // ddy_coarse builtin
648+ // ===----------------------------------------------------------------------===//
649+
650+ // / \fn T ddy_coarse(T value)
651+ // / \brief Computes a low precision partial derivative with respect to the
652+ // / screen-space y-coordinate.
653+ // / \param value The input value.
654+ // /
655+ // / The return value is a floating point scalar or vector containing the low
656+ // / prevision partial derivative of the input value.
657+
658+ template <typename T>
659+ const inline __detail::enable_if_t <
660+ __detail::is_arithmetic<T>::Value && __detail::is_same<half, T>::value, T>
661+ ddy_coarse (T value) {
662+ return __detail::ddy_coarse_impl (value);
663+ }
664+
665+ template <typename T>
666+ const inline __detail::enable_if_t <
667+ __detail::is_arithmetic<T>::Value && __detail::is_same<float , T>::value, T>
668+ ddy_coarse (T value) {
669+ return __detail::ddy_coarse_impl (value);
670+ }
671+
672+ template <int L>
673+ const inline __detail::HLSL_FIXED_VECTOR<half, L>
674+ ddy_coarse (__detail::HLSL_FIXED_VECTOR<half, L> value) {
675+ return __detail::ddy_coarse_impl (value);
676+ }
677+
678+ template <int L>
679+ const inline __detail::HLSL_FIXED_VECTOR<float , L>
680+ ddy_coarse (__detail::HLSL_FIXED_VECTOR<float , L> value) {
681+ return __detail::ddy_coarse_impl (value);
682+ }
683+
608684} // namespace hlsl
609685#endif // _HLSL_HLSL_INTRINSICS_H_
0 commit comments