diff options
| author | 2023-01-29 13:54:13 -0700 | |
|---|---|---|
| committer | 2023-01-29 17:49:42 -0700 | |
| commit | d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea (patch) | |
| tree | 4bbcaee76bde35ddc6eff9a1c639866cf278b353 /src/common/vector_math.h | |
| parent | Merge pull request #9699 from ameerj/texture-pass-desc (diff) | |
| download | yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.tar.gz yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.tar.xz yuzu-d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea.zip | |
Move to Clang Format 15
Depends on https://github.com/yuzu-emu/build-environments/pull/69
clang-15 primary run
Diffstat (limited to 'src/common/vector_math.h')
| -rw-r--r-- | src/common/vector_math.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h index e62eeea2e..0e2095c45 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h | |||
| @@ -348,9 +348,7 @@ public: | |||
| 348 | // _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all | 348 | // _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all |
| 349 | // component names (x<->r) and permutations (xy<->yx) | 349 | // component names (x<->r) and permutations (xy<->yx) |
| 350 | #define _DEFINE_SWIZZLER2(a, b, name) \ | 350 | #define _DEFINE_SWIZZLER2(a, b, name) \ |
| 351 | [[nodiscard]] constexpr Vec2<T> name() const { \ | 351 | [[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); } |
| 352 | return Vec2<T>(a, b); \ | ||
| 353 | } | ||
| 354 | #define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \ | 352 | #define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \ |
| 355 | _DEFINE_SWIZZLER2(a, b, a##b); \ | 353 | _DEFINE_SWIZZLER2(a, b, a##b); \ |
| 356 | _DEFINE_SWIZZLER2(a, b, a2##b2); \ | 354 | _DEFINE_SWIZZLER2(a, b, a2##b2); \ |
| @@ -543,9 +541,7 @@ public: | |||
| 543 | // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and | 541 | // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and |
| 544 | // permutations (xy<->yx) | 542 | // permutations (xy<->yx) |
| 545 | #define _DEFINE_SWIZZLER2(a, b, name) \ | 543 | #define _DEFINE_SWIZZLER2(a, b, name) \ |
| 546 | [[nodiscard]] constexpr Vec2<T> name() const { \ | 544 | [[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); } |
| 547 | return Vec2<T>(a, b); \ | ||
| 548 | } | ||
| 549 | #define DEFINE_SWIZZLER2_COMP1(a, a2) \ | 545 | #define DEFINE_SWIZZLER2_COMP1(a, a2) \ |
| 550 | _DEFINE_SWIZZLER2(a, a, a##a); \ | 546 | _DEFINE_SWIZZLER2(a, a, a##a); \ |
| 551 | _DEFINE_SWIZZLER2(a, a, a2##a2) | 547 | _DEFINE_SWIZZLER2(a, a, a2##a2) |
| @@ -570,9 +566,7 @@ public: | |||
| 570 | #undef _DEFINE_SWIZZLER2 | 566 | #undef _DEFINE_SWIZZLER2 |
| 571 | 567 | ||
| 572 | #define _DEFINE_SWIZZLER3(a, b, c, name) \ | 568 | #define _DEFINE_SWIZZLER3(a, b, c, name) \ |
| 573 | [[nodiscard]] constexpr Vec3<T> name() const { \ | 569 | [[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); } |
| 574 | return Vec3<T>(a, b, c); \ | ||
| 575 | } | ||
| 576 | #define DEFINE_SWIZZLER3_COMP1(a, a2) \ | 570 | #define DEFINE_SWIZZLER3_COMP1(a, a2) \ |
| 577 | _DEFINE_SWIZZLER3(a, a, a, a##a##a); \ | 571 | _DEFINE_SWIZZLER3(a, a, a, a##a##a); \ |
| 578 | _DEFINE_SWIZZLER3(a, a, a, a2##a2##a2) | 572 | _DEFINE_SWIZZLER3(a, a, a, a2##a2##a2) |
| @@ -641,8 +635,8 @@ template <typename T> | |||
| 641 | 635 | ||
| 642 | // linear interpolation via float: 0.0=begin, 1.0=end | 636 | // linear interpolation via float: 0.0=begin, 1.0=end |
| 643 | template <typename X> | 637 | template <typename X> |
| 644 | [[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) | 638 | [[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) Lerp(const X& begin, const X& end, |
| 645 | Lerp(const X& begin, const X& end, const float t) { | 639 | const float t) { |
| 646 | return begin * (1.f - t) + end * t; | 640 | return begin * (1.f - t) + end * t; |
| 647 | } | 641 | } |
| 648 | 642 | ||