From 32a8b7d97139c25d6c933daed30678abd08d24d6 Mon Sep 17 00:00:00 2001 From: Maxime Houis Date: Sat, 5 Mar 2022 01:38:45 +0100 Subject: [PATCH 1/4] ci: bump clang format version --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 394b7d9..40a3c09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,9 +21,9 @@ jobs: - uses: actions/checkout@v2 - name: Run clang-format - uses: jidicula/clang-format-action@v4.4.0 + uses: jidicula/clang-format-action@v4.6.1 with: - clang-format-version: '13' + clang-format-version: '14' build: strategy: From 4fbe0ae3b1c24d0d41df30eb8f3a75977dddc053 Mon Sep 17 00:00:00 2001 From: Maxime Houis Date: Wed, 9 Mar 2022 00:29:30 +0100 Subject: [PATCH 2/4] perf: slight Color perf improvement --- lib/include/Vulk/Color.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/include/Vulk/Color.hpp b/lib/include/Vulk/Color.hpp index 4b7af27..1bc8242 100644 --- a/lib/include/Vulk/Color.hpp +++ b/lib/include/Vulk/Color.hpp @@ -57,11 +57,11 @@ struct Color uint32_t value = r; value <<= 8; - value += g; + value |= g; value <<= 8; - value += b; + value |= b; value <<= 8; - value += a; + value |= a; return value; } From a0f89da29a8195f9e15a9092ae468c30b90f9bf3 Mon Sep 17 00:00:00 2001 From: Maxime Houis Date: Wed, 9 Mar 2022 00:35:10 +0100 Subject: [PATCH 3/4] imp: add missing operators for Vec2 and Vec3 --- lib/include/Vulk/Vec2.hpp | 7 +++++++ lib/include/Vulk/Vec3.hpp | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/include/Vulk/Vec2.hpp b/lib/include/Vulk/Vec2.hpp index db0db85..37b5121 100644 --- a/lib/include/Vulk/Vec2.hpp +++ b/lib/include/Vulk/Vec2.hpp @@ -33,6 +33,13 @@ struct Vec2 constexpr Vec2(T aX, T aY) : x{aX}, y{aY} {} constexpr explicit Vec2(T value) : x{value}, y{value} {} + constexpr Vec2(Vec2&&) noexcept = default; + constexpr Vec2(const Vec2&) noexcept = default; + constexpr Vec2& operator=(Vec2&&) noexcept = default; + constexpr Vec2& operator=(const Vec2&) noexcept = default; + + constexpr auto operator<=>(const Vec2&) const noexcept = default; + constexpr Vec2 operator-() const noexcept { return Vec2{-x, -y}; } constexpr Vec2& operator+=(const Vec2& rhs) diff --git a/lib/include/Vulk/Vec3.hpp b/lib/include/Vulk/Vec3.hpp index 57589c8..8c4fa00 100644 --- a/lib/include/Vulk/Vec3.hpp +++ b/lib/include/Vulk/Vec3.hpp @@ -20,6 +20,7 @@ #pragma once #include +#include #include namespace vulk { @@ -34,6 +35,13 @@ struct Vec3 constexpr Vec3(T aX, T aY, T aZ) : x{aX}, y{aY}, z{aZ} {} constexpr explicit Vec3(T value) : x{value}, y{value}, z{value} {} + constexpr Vec3(Vec3&&) noexcept = default; + constexpr Vec3(const Vec3&) noexcept = default; + constexpr Vec3& operator=(Vec3&&) noexcept = default; + constexpr Vec3& operator=(const Vec3&) noexcept = default; + + constexpr auto operator<=>(const Vec3&) const noexcept = default; + constexpr Vec3 operator-() const noexcept { return Vec3{-x, -y, -z}; } constexpr Vec3& operator+=(const Vec3& rhs) From fcc502aa69b6b24799fd2657229997f5b9e687b2 Mon Sep 17 00:00:00 2001 From: Maxime Houis Date: Wed, 9 Mar 2022 00:35:59 +0100 Subject: [PATCH 4/4] other: add missing include from previous commit --- lib/include/Vulk/Vec2.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/include/Vulk/Vec2.hpp b/lib/include/Vulk/Vec2.hpp index 37b5121..716fabf 100644 --- a/lib/include/Vulk/Vec2.hpp +++ b/lib/include/Vulk/Vec2.hpp @@ -20,6 +20,7 @@ #pragma once #include +#include #include namespace vulk {