You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#defineALIAS_STD(NAME,OP) template<typename T> struct NAME : std::NAME<T> { \
96
104
using type_t = T;
97
105
106
+
#defineALIAS_STD_CMP(NAME,OP) template<typename T> struct NAME : std::NAME<T> { \
107
+
using type_t = T;
108
+
98
109
#endif
99
110
100
111
ALIAS_STD(bit_and,&)
@@ -136,14 +147,15 @@ ALIAS_STD(divides,/)
136
147
};
137
148
138
149
139
-
ALIAS_STD(equal_to, ==) };
140
-
ALIAS_STD(not_equal_to, !=) };
141
-
ALIAS_STD(greater, >) };
142
-
ALIAS_STD(less, <) };
143
-
ALIAS_STD(greater_equal, >=) };
144
-
ALIAS_STD(less_equal, <=) };
150
+
ALIAS_STD_CMP(equal_to, ==) };
151
+
ALIAS_STD_CMP(not_equal_to, !=) };
152
+
ALIAS_STD_CMP(greater, >) };
153
+
ALIAS_STD_CMP(less, <) };
154
+
ALIAS_STD_CMP(greater_equal, >=) };
155
+
ALIAS_STD_CMP(less_equal, <=) };
145
156
146
157
#undef ALIAS_STD
158
+
#undef ALIAS_STD_CMP
147
159
148
160
// The above comparison operators return bool on STD, but in HLSL they're supposed to yield bool vectors, so here's a specialization so that they return `vector<bool, N>` for vectorial types
template <typename T NBL_FUNC_REQUIRES(concepts::FloatingPointLikeScalar<T>)
96
+
// UseRealSinCos=true -> back-to-back sin + cos. Saturates the special-function pipeline, enables vendor sincos fusion, full precision near multiples of pi.
97
+
// UseRealSinCos=false -> cos + sqrt(1-c*c) with sign recovered from theta. Saves one special-function op when cos alone is cheaper than sin+cos, but suffers catastrophic cancellation as |c| -> 1.
0 commit comments