update headers

This commit is contained in:
Nick Fisher
2022-12-05 17:51:44 +08:00
parent 8d562f1742
commit dd100653dc
234 changed files with 62619 additions and 9800 deletions

View File

@@ -243,7 +243,9 @@ public:
uint64_t result = 0;
// For some reason clang is not able to vectoize this loop when the number of iteration
// is known and constant (!?!?!). Still this is better than operator==.
#if defined(__clang__)
#pragma clang loop vectorize_width(2)
#endif
for (size_t i = 0; i < sizeof(TMat22) / sizeof(uint64_t); i++) {
result |= li[i] ^ ri[i];
}

View File

@@ -491,11 +491,22 @@ template<typename T>
constexpr TMat44<T> TMat44<T>::frustum(T left, T right, T bottom, T top, T near, T far) noexcept {
TMat44<T> m;
m[0][0] = (2 * near) / (right - left);
// 0
// 0
// 0
// 0
m[1][1] = (2 * near) / (top - bottom);
// 0
// 0
m[2][0] = (right + left) / (right - left);
m[2][1] = (top + bottom) / (top - bottom);
m[2][2] = -(far + near) / (far - near);
m[2][3] = -1;
// 0
// 0
m[3][2] = -(2 * far * near) / (far - near);
m[3][3] = 0;
return m;