@@ -22,27 +22,27 @@ namespace hlsl {
2222// ===----------------------------------------------------------------------===//
2323
2424template <typename T, typename R, typename U, uint N>
25- constexpr __detail::enable_if_t <__detail::is_arithmetic<U>::Value, vector<T, N>>
25+ constexpr __detail::enable_if_t <__detail::is_arithmetic<U>::Value && (N > 1 && N <= 4 ) , vector<T, N>>
2626clamp (vector<T, N> p0, vector<R, N> p1, U p2) {
2727 return __builtin_hlsl_elementwise_clamp (p0, (vector<T, N>)p1,
2828 (vector<T, N>)p2);
2929}
3030template <typename T, typename R, typename U, uint N>
31- constexpr __detail::enable_if_t <__detail::is_arithmetic<U>::Value, vector<T, N>>
31+ constexpr __detail::enable_if_t <__detail::is_arithmetic<U>::Value && (N > 1 && N <= 4 ) , vector<T, N>>
3232clamp (vector<T, N> p0, U p1, vector<R, N> p2) {
3333 return __builtin_hlsl_elementwise_clamp (p0, (vector<T, N>)p1,
3434 (vector<T, N>)p2);
3535}
3636template <typename T, typename U, typename V, uint N>
3737constexpr __detail::enable_if_t <__detail::is_arithmetic<U>::Value &&
38- __detail::is_arithmetic<V>::Value,
38+ __detail::is_arithmetic<V>::Value && (N > 1 && N <= 4 ) ,
3939 vector<T, N>>
4040clamp (vector<T, N> p0, U p1, V p2) {
4141 return __builtin_hlsl_elementwise_clamp (p0, (vector<T, N>)p1,
4242 (vector<T, N>)p2);
4343}
4444template <typename T, typename R, typename S, uint N>
45- constexpr vector<T, N> clamp (vector<T, N> p0, vector<R, N> p1,
45+ constexpr __detail:: enable_if_t <(N > 1 && N <= 4 ), vector<T, N> > clamp (vector<T, N> p0, vector<R, N> p1,
4646 vector<S, N> p2) {
4747 return __builtin_hlsl_elementwise_clamp (p0, (vector<T, N>)p1,
4848 (vector<T, N>)p2);
0 commit comments