From 8c756f4f3a5609d44a5597871a510edccfbf7545 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Mon, 30 Jan 2023 16:29:43 +0100 Subject: [PATCH] early-access version 3352 --- CMakeLists.txt | 2 +- README.md | 2 +- src/common/address_space.h | 7 +- src/common/alignment.h | 18 ++--- src/common/atomic_helpers.h | 2 +- src/common/bit_util.h | 6 +- src/common/concepts.h | 6 +- src/common/div_ceil.h | 4 +- src/common/expected.h | 60 +++++++-------- src/common/intrusive_red_black_tree.h | 20 ++--- src/common/make_unique_for_overwrite.h | 8 +- src/common/polyfill_ranges.h | 8 +- src/common/polyfill_thread.h | 4 +- src/common/settings.h | 12 ++- src/common/tree.h | 74 +++++++++---------- src/common/vector_math.h | 16 ++-- src/core/hle/kernel/k_auto_object.h | 20 ++--- src/core/hle/kernel/k_capabilities.cpp | 2 +- src/core/hle/kernel/k_priority_queue.h | 50 +++++++------ src/core/hle/kernel/k_scoped_lock.h | 11 +-- src/core/hle/kernel/k_thread.h | 8 +- src/core/hle/kernel/k_thread_local_page.h | 6 +- .../helpers/joycon_protocol/common_protocol.h | 7 +- .../backend/glasm/emit_glasm_image.cpp | 10 ++- .../backend/glsl/emit_glsl_image.cpp | 32 +++++--- .../backend/spirv/emit_spirv_image.cpp | 25 +++++-- .../backend/spirv/spirv_emit_context.cpp | 1 + .../backend/spirv/spirv_emit_context.h | 1 + .../frontend/ir/ir_emitter.h | 3 +- src/shader_recompiler/frontend/ir/value.h | 13 ++-- src/shader_recompiler/object_pool.h | 4 +- .../texture_cache/descriptor_table.h | 4 +- src/video_core/texture_cache/slot_vector.h | 2 +- 33 files changed, 239 insertions(+), 209 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec58f89d9..c455e73ba 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,7 +514,7 @@ endif() # against all the src files. This should be used before making a pull request. # ======================================================================= -set(CLANG_FORMAT_POSTFIX "-12") +set(CLANG_FORMAT_POSTFIX "-15") find_program(CLANG_FORMAT NAMES clang-format${CLANG_FORMAT_POSTFIX} clang-format diff --git a/README.md b/README.md index 72aecfc30..9836c99f8 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3351. +This is the source code for early-access 3352. ## Legal Notice diff --git a/src/common/address_space.h b/src/common/address_space.h index 6f5debe25..6f766dfee 100755 --- a/src/common/address_space.h +++ b/src/common/address_space.h @@ -12,7 +12,8 @@ namespace Common { template -concept AddressSpaceValid = std::is_unsigned_v && sizeof(VaType) * 8 >= AddressSpaceBits; +concept AddressSpaceValid = std::is_unsigned_v && sizeof(VaType) * 8 >= +AddressSpaceBits; struct EmptyStruct {}; @@ -21,7 +22,7 @@ struct EmptyStruct {}; */ template -requires AddressSpaceValid + requires AddressSpaceValid class FlatAddressSpaceMap { public: /// The maximum VA that this AS can technically reach @@ -109,7 +110,7 @@ private: * initial, fast linear pass and a subsequent slower pass that iterates until it finds a free block */ template -requires AddressSpaceValid + requires AddressSpaceValid class FlatAllocator : public FlatAddressSpaceMap { private: diff --git a/src/common/alignment.h b/src/common/alignment.h index f3435f3e0..ea95d8258 100755 --- a/src/common/alignment.h +++ b/src/common/alignment.h @@ -10,7 +10,7 @@ namespace Common { template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr T AlignUp(T value, size_t size) { auto mod{static_cast(value % size)}; value -= mod; @@ -18,31 +18,31 @@ requires std::is_unsigned_v } template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr T AlignUpLog2(T value, size_t align_log2) { return static_cast((value + ((1ULL << align_log2) - 1)) >> align_log2 << align_log2); } template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr T AlignDown(T value, size_t size) { return static_cast(value - value % size); } template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr bool Is4KBAligned(T value) { return (value & 0xFFF) == 0; } template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr bool IsWordAligned(T value) { return (value & 0b11) == 0; } template -requires std::is_integral_v + requires std::is_integral_v [[nodiscard]] constexpr bool IsAligned(T value, size_t alignment) { using U = typename std::make_unsigned_t; const U mask = static_cast(alignment - 1); @@ -50,7 +50,7 @@ requires std::is_integral_v } template -requires std::is_integral_v + requires std::is_integral_v [[nodiscard]] constexpr T DivideUp(T x, U y) { return (x + (y - 1)) / y; } @@ -73,11 +73,11 @@ public: constexpr AlignmentAllocator(const AlignmentAllocator&) noexcept {} [[nodiscard]] T* allocate(size_type n) { - return static_cast(::operator new (n * sizeof(T), std::align_val_t{Align})); + return static_cast(::operator new(n * sizeof(T), std::align_val_t{Align})); } void deallocate(T* p, size_type n) { - ::operator delete (p, n * sizeof(T), std::align_val_t{Align}); + ::operator delete(p, n * sizeof(T), std::align_val_t{Align}); } template diff --git a/src/common/atomic_helpers.h b/src/common/atomic_helpers.h index 19fecbbad..014843dff 100755 --- a/src/common/atomic_helpers.h +++ b/src/common/atomic_helpers.h @@ -75,7 +75,7 @@ extern "C" void AnnotateHappensAfter(const char*, int, void*); #if defined(AE_VCPP) || defined(AE_ICC) #define AE_FORCEINLINE __forceinline #elif defined(AE_GCC) -//#define AE_FORCEINLINE __attribute__((always_inline)) +// #define AE_FORCEINLINE __attribute__((always_inline)) #define AE_FORCEINLINE inline #else #define AE_FORCEINLINE inline diff --git a/src/common/bit_util.h b/src/common/bit_util.h index 82b1d2284..5d70b19e9 100755 --- a/src/common/bit_util.h +++ b/src/common/bit_util.h @@ -45,19 +45,19 @@ template } template -requires std::is_unsigned_v + requires std::is_unsigned_v [[nodiscard]] constexpr bool IsPow2(T value) { return std::has_single_bit(value); } template -requires std::is_integral_v + requires std::is_integral_v [[nodiscard]] T NextPow2(T value) { return static_cast(1ULL << ((8U * sizeof(T)) - std::countl_zero(value - 1U))); } template -requires std::is_integral_v + requires std::is_integral_v [[nodiscard]] constexpr bool Bit(const T value) { static_assert(bit_index < BitSize(), "bit_index must be smaller than size of T"); return ((value >> bit_index) & T(1)) == T(1); diff --git a/src/common/concepts.h b/src/common/concepts.h index 385e928eb..d42eb07fe 100755 --- a/src/common/concepts.h +++ b/src/common/concepts.h @@ -16,9 +16,9 @@ concept IsContiguousContainer = std::contiguous_iterator; // is available on all supported platforms. template concept DerivedFrom = requires { - std::is_base_of_v; - std::is_convertible_v; -}; + std::is_base_of_v; + std::is_convertible_v; + }; // TODO: Replace with std::convertible_to when libc++ implements it. template diff --git a/src/common/div_ceil.h b/src/common/div_ceil.h index 718412add..de275e76f 100755 --- a/src/common/div_ceil.h +++ b/src/common/div_ceil.h @@ -10,14 +10,14 @@ namespace Common { /// Ceiled integer division. template -requires std::is_integral_v && std::is_unsigned_v + requires std::is_integral_v && std::is_unsigned_v [[nodiscard]] constexpr N DivCeil(N number, D divisor) { return static_cast((static_cast(number) + divisor - 1) / divisor); } /// Ceiled integer division with logarithmic divisor in base 2 template -requires std::is_integral_v && std::is_unsigned_v + requires std::is_integral_v && std::is_unsigned_v [[nodiscard]] constexpr N DivCeilLog2(N value, D alignment_log2) { return static_cast((static_cast(value) + (D(1) << alignment_log2) - 1) >> alignment_log2); } diff --git a/src/common/expected.h b/src/common/expected.h index f533ada94..139427ecf 100755 --- a/src/common/expected.h +++ b/src/common/expected.h @@ -64,7 +64,7 @@ struct no_init_t { * Additionally, this requires E to be trivially destructible */ template > -requires std::is_trivially_destructible_v + requires std::is_trivially_destructible_v struct expected_storage_base { constexpr expected_storage_base() : m_val{T{}}, m_has_val{true} {} @@ -111,7 +111,7 @@ struct expected_storage_base { * Additionally, this requires E to be trivially destructible */ template -requires std::is_trivially_destructible_v + requires std::is_trivially_destructible_v struct expected_storage_base { constexpr expected_storage_base() : m_val{T{}}, m_has_val{true} {} @@ -251,7 +251,7 @@ struct expected_operations_base : expected_storage_base { * Additionally, this requires E to be trivially copy constructible */ template > -requires std::is_trivially_copy_constructible_v + requires std::is_trivially_copy_constructible_v struct expected_copy_base : expected_operations_base { using expected_operations_base::expected_operations_base; }; @@ -261,7 +261,7 @@ struct expected_copy_base : expected_operations_base { * Additionally, this requires E to be trivially copy constructible */ template -requires std::is_trivially_copy_constructible_v + requires std::is_trivially_copy_constructible_v struct expected_copy_base : expected_operations_base { using expected_operations_base::expected_operations_base; @@ -289,7 +289,7 @@ struct expected_copy_base : expected_operations_base { * Additionally, this requires E to be trivially move constructible */ template > -requires std::is_trivially_move_constructible_v + requires std::is_trivially_move_constructible_v struct expected_move_base : expected_copy_base { using expected_copy_base::expected_copy_base; }; @@ -299,7 +299,7 @@ struct expected_move_base : expected_copy_base { * Additionally, this requires E to be trivially move constructible */ template -requires std::is_trivially_move_constructible_v + requires std::is_trivially_move_constructible_v struct expected_move_base : expected_copy_base { using expected_copy_base::expected_copy_base; @@ -330,9 +330,9 @@ template , std::is_trivially_copy_constructible, std::is_trivially_destructible>> -requires std::conjunction_v, - std::is_trivially_copy_constructible, - std::is_trivially_destructible> + requires std::conjunction_v, + std::is_trivially_copy_constructible, + std::is_trivially_destructible> struct expected_copy_assign_base : expected_move_base { using expected_move_base::expected_move_base; }; @@ -342,9 +342,9 @@ struct expected_copy_assign_base : expected_move_base { * Additionally, this requires E to be trivially copy assignable */ template -requires std::conjunction_v, - std::is_trivially_copy_constructible, - std::is_trivially_destructible> + requires std::conjunction_v, + std::is_trivially_copy_constructible, + std::is_trivially_destructible> struct expected_copy_assign_base : expected_move_base { using expected_move_base::expected_move_base; @@ -371,9 +371,9 @@ template , std::is_trivially_move_constructible, std::is_trivially_destructible>> -requires std::conjunction_v, - std::is_trivially_move_constructible, - std::is_trivially_destructible> + requires std::conjunction_v, + std::is_trivially_move_constructible, + std::is_trivially_destructible> struct expected_move_assign_base : expected_copy_assign_base { using expected_copy_assign_base::expected_copy_assign_base; }; @@ -383,9 +383,9 @@ struct expected_move_assign_base : expected_copy_assign_base { * Additionally, this requires E to be trivially move assignable */ template -requires std::conjunction_v, - std::is_trivially_move_constructible, - std::is_trivially_destructible> + requires std::conjunction_v, + std::is_trivially_move_constructible, + std::is_trivially_destructible> struct expected_move_assign_base : expected_copy_assign_base { using expected_copy_assign_base::expected_copy_assign_base; @@ -412,7 +412,7 @@ struct expected_move_assign_base : expected_copy_assign_base */ template , bool EnableMove = std::is_move_constructible_v> -requires std::conjunction_v, std::is_move_constructible> + requires std::conjunction_v, std::is_move_constructible> struct expected_delete_ctor_base { expected_delete_ctor_base() = default; expected_delete_ctor_base(const expected_delete_ctor_base&) = default; @@ -422,7 +422,7 @@ struct expected_delete_ctor_base { }; template -requires std::conjunction_v, std::is_move_constructible> + requires std::conjunction_v, std::is_move_constructible> struct expected_delete_ctor_base { expected_delete_ctor_base() = default; expected_delete_ctor_base(const expected_delete_ctor_base&) = default; @@ -432,7 +432,7 @@ struct expected_delete_ctor_base { }; template -requires std::conjunction_v, std::is_move_constructible> + requires std::conjunction_v, std::is_move_constructible> struct expected_delete_ctor_base { expected_delete_ctor_base() = default; expected_delete_ctor_base(const expected_delete_ctor_base&) = delete; @@ -442,7 +442,7 @@ struct expected_delete_ctor_base { }; template -requires std::conjunction_v, std::is_move_constructible> + requires std::conjunction_v, std::is_move_constructible> struct expected_delete_ctor_base { expected_delete_ctor_base() = default; expected_delete_ctor_base(const expected_delete_ctor_base&) = delete; @@ -460,8 +460,8 @@ template < typename T, typename E, bool EnableCopy = std::conjunction_v, std::is_copy_assignable>, bool EnableMove = std::conjunction_v, std::is_move_assignable>> -requires std::conjunction_v, std::is_move_constructible, - std::is_copy_assignable, std::is_move_assignable> + requires std::conjunction_v, std::is_move_constructible, + std::is_copy_assignable, std::is_move_assignable> struct expected_delete_assign_base { expected_delete_assign_base() = default; expected_delete_assign_base(const expected_delete_assign_base&) = default; @@ -471,8 +471,8 @@ struct expected_delete_assign_base { }; template -requires std::conjunction_v, std::is_move_constructible, - std::is_copy_assignable, std::is_move_assignable> + requires std::conjunction_v, std::is_move_constructible, + std::is_copy_assignable, std::is_move_assignable> struct expected_delete_assign_base { expected_delete_assign_base() = default; expected_delete_assign_base(const expected_delete_assign_base&) = default; @@ -482,8 +482,8 @@ struct expected_delete_assign_base { }; template -requires std::conjunction_v, std::is_move_constructible, - std::is_copy_assignable, std::is_move_assignable> + requires std::conjunction_v, std::is_move_constructible, + std::is_copy_assignable, std::is_move_assignable> struct expected_delete_assign_base { expected_delete_assign_base() = default; expected_delete_assign_base(const expected_delete_assign_base&) = default; @@ -493,8 +493,8 @@ struct expected_delete_assign_base { }; template -requires std::conjunction_v, std::is_move_constructible, - std::is_copy_assignable, std::is_move_assignable> + requires std::conjunction_v, std::is_move_constructible, + std::is_copy_assignable, std::is_move_assignable> struct expected_delete_assign_base { expected_delete_assign_base() = default; expected_delete_assign_base(const expected_delete_assign_base&) = default; diff --git a/src/common/intrusive_red_black_tree.h b/src/common/intrusive_red_black_tree.h index 429b99aea..aa575846b 100755 --- a/src/common/intrusive_red_black_tree.h +++ b/src/common/intrusive_red_black_tree.h @@ -242,19 +242,21 @@ public: template concept HasRedBlackKeyType = requires { - { std::is_same::value } -> std::convertible_to; -}; + { + std::is_same::value + } -> std::convertible_to; + }; namespace impl { - template - consteval auto* GetRedBlackKeyType() { - if constexpr (HasRedBlackKeyType) { - return static_cast(nullptr); - } else { - return static_cast(nullptr); - } +template +consteval auto* GetRedBlackKeyType() { + if constexpr (HasRedBlackKeyType) { + return static_cast(nullptr); + } else { + return static_cast(nullptr); } +} } // namespace impl diff --git a/src/common/make_unique_for_overwrite.h b/src/common/make_unique_for_overwrite.h index c7413cf51..17f81bba4 100755 --- a/src/common/make_unique_for_overwrite.h +++ b/src/common/make_unique_for_overwrite.h @@ -9,17 +9,19 @@ namespace Common { template -requires(!std::is_array_v) std::unique_ptr make_unique_for_overwrite() { + requires(!std::is_array_v) +std::unique_ptr make_unique_for_overwrite() { return std::unique_ptr(new T); } template -requires std::is_unbounded_array_v std::unique_ptr make_unique_for_overwrite(std::size_t n) { + requires std::is_unbounded_array_v +std::unique_ptr make_unique_for_overwrite(std::size_t n) { return std::unique_ptr(new std::remove_extent_t[n]); } template -requires std::is_bounded_array_v + requires std::is_bounded_array_v void make_unique_for_overwrite(Args&&...) = delete; } // namespace Common diff --git a/src/common/polyfill_ranges.h b/src/common/polyfill_ranges.h index ca44bfaef..512dbcbcb 100755 --- a/src/common/polyfill_ranges.h +++ b/src/common/polyfill_ranges.h @@ -18,9 +18,9 @@ namespace ranges { template concept range = requires(T& t) { - begin(t); - end(t); -}; + begin(t); + end(t); + }; template concept input_range = range; @@ -421,7 +421,7 @@ struct generate_fn { } template - requires std::invocable && ranges::output_range + requires std::invocable && ranges::output_range constexpr ranges::iterator_t operator()(R&& r, F gen) const { return operator()(ranges::begin(r), ranges::end(r), std::move(gen)); } diff --git a/src/common/polyfill_thread.h b/src/common/polyfill_thread.h index b4c94a5fc..b5ef055db 100755 --- a/src/common/polyfill_thread.h +++ b/src/common/polyfill_thread.h @@ -213,7 +213,7 @@ public: using callback_type = Callback; template - requires constructible_from + requires constructible_from explicit stop_callback(const stop_token& st, C&& cb) noexcept(is_nothrow_constructible_v) : m_stop_state(st.m_stop_state) { @@ -222,7 +222,7 @@ public: } } template - requires constructible_from + requires constructible_from explicit stop_callback(stop_token&& st, C&& cb) noexcept(is_nothrow_constructible_v) : m_stop_state(move(st.m_stop_state)) { diff --git a/src/common/settings.h b/src/common/settings.h index 3958298ef..5dd4d8b43 100755 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -131,7 +131,8 @@ public: * @param default_val Intial value of the setting, and default value of the setting * @param name Label for the setting */ - explicit Setting(const Type& default_val, const std::string& name) requires(!ranged) + explicit Setting(const Type& default_val, const std::string& name) + requires(!ranged) : value{default_val}, default_value{default_val}, label{name} {} virtual ~Setting() = default; @@ -144,7 +145,8 @@ public: * @param name Label for the setting */ explicit Setting(const Type& default_val, const Type& min_val, const Type& max_val, - const std::string& name) requires(ranged) + const std::string& name) + requires(ranged) : value{default_val}, default_value{default_val}, maximum{max_val}, minimum{min_val}, label{name} {} @@ -232,7 +234,8 @@ public: * @param default_val Intial value of the setting, and default value of the setting * @param name Label for the setting */ - explicit SwitchableSetting(const Type& default_val, const std::string& name) requires(!ranged) + explicit SwitchableSetting(const Type& default_val, const std::string& name) + requires(!ranged) : Setting{default_val, name} {} virtual ~SwitchableSetting() = default; @@ -245,7 +248,8 @@ public: * @param name Label for the setting */ explicit SwitchableSetting(const Type& default_val, const Type& min_val, const Type& max_val, - const std::string& name) requires(ranged) + const std::string& name) + requires(ranged) : Setting{default_val, min_val, max_val, name} {} /** diff --git a/src/common/tree.h b/src/common/tree.h index 13a1170e8..96e962938 100755 --- a/src/common/tree.h +++ b/src/common/tree.h @@ -103,12 +103,12 @@ concept IsRBEntry = CheckRBEntry::value; template concept HasRBEntry = requires(T& t, const T& ct) { - { t.GetRBEntry() } -> std::same_as&>; - { ct.GetRBEntry() } -> std::same_as&>; -}; + { t.GetRBEntry() } -> std::same_as&>; + { ct.GetRBEntry() } -> std::same_as&>; + }; template -requires HasRBEntry + requires HasRBEntry class RBHead { private: T* m_rbh_root = nullptr; @@ -130,90 +130,90 @@ public: }; template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr RBEntry& RB_ENTRY(T* t) { return t->GetRBEntry(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const RBEntry& RB_ENTRY(const T* t) { return t->GetRBEntry(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_LEFT(T* t) { return RB_ENTRY(t).Left(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_LEFT(const T* t) { return RB_ENTRY(t).Left(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_RIGHT(T* t) { return RB_ENTRY(t).Right(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_RIGHT(const T* t) { return RB_ENTRY(t).Right(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_PARENT(T* t) { return RB_ENTRY(t).Parent(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_PARENT(const T* t) { return RB_ENTRY(t).Parent(); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_LEFT(T* t, T* e) { RB_ENTRY(t).SetLeft(e); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_RIGHT(T* t, T* e) { RB_ENTRY(t).SetRight(e); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_PARENT(T* t, T* e) { RB_ENTRY(t).SetParent(e); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr bool RB_IS_BLACK(const T* t) { return RB_ENTRY(t).IsBlack(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr bool RB_IS_RED(const T* t) { return RB_ENTRY(t).IsRed(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr RBColor RB_COLOR(const T* t) { return RB_ENTRY(t).Color(); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_COLOR(T* t, RBColor c) { RB_ENTRY(t).SetColor(c); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET(T* elm, T* parent) { auto& rb_entry = RB_ENTRY(elm); rb_entry.SetParent(parent); @@ -223,14 +223,14 @@ constexpr void RB_SET(T* elm, T* parent) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_BLACKRED(T* black, T* red) { RB_SET_COLOR(black, RBColor::RB_BLACK); RB_SET_COLOR(red, RBColor::RB_RED); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_ROTATE_LEFT(RBHead& head, T* elm, T*& tmp) { tmp = RB_RIGHT(elm); if (RB_SET_RIGHT(elm, RB_LEFT(tmp)); RB_RIGHT(elm) != nullptr) { @@ -252,7 +252,7 @@ constexpr void RB_ROTATE_LEFT(RBHead& head, T* elm, T*& tmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_ROTATE_RIGHT(RBHead& head, T* elm, T*& tmp) { tmp = RB_LEFT(elm); if (RB_SET_LEFT(elm, RB_RIGHT(tmp)); RB_LEFT(elm) != nullptr) { @@ -274,7 +274,7 @@ constexpr void RB_ROTATE_RIGHT(RBHead& head, T* elm, T*& tmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_REMOVE_COLOR(RBHead& head, T* parent, T* elm) { T* tmp; while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head.Root()) { @@ -358,7 +358,7 @@ constexpr void RB_REMOVE_COLOR(RBHead& head, T* parent, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_REMOVE(RBHead& head, T* elm) { T* child = nullptr; T* parent = nullptr; @@ -451,7 +451,7 @@ constexpr T* RB_REMOVE(RBHead& head, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_INSERT_COLOR(RBHead& head, T* elm) { T *parent = nullptr, *tmp = nullptr; while ((parent = RB_PARENT(elm)) != nullptr && RB_IS_RED(parent)) { @@ -499,7 +499,7 @@ constexpr void RB_INSERT_COLOR(RBHead& head, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_INSERT(RBHead& head, T* elm, Compare cmp) { T* parent = nullptr; T* tmp = head.Root(); @@ -534,7 +534,7 @@ constexpr T* RB_INSERT(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); @@ -553,7 +553,7 @@ constexpr T* RB_FIND(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NFIND(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); T* res = nullptr; @@ -574,7 +574,7 @@ constexpr T* RB_NFIND(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); @@ -593,7 +593,7 @@ constexpr T* RB_FIND_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NFIND_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); T* res = nullptr; @@ -614,7 +614,7 @@ constexpr T* RB_NFIND_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_EXISTING(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); @@ -631,7 +631,7 @@ constexpr T* RB_FIND_EXISTING(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_EXISTING_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); @@ -648,7 +648,7 @@ constexpr T* RB_FIND_EXISTING_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NEXT(T* elm) { if (RB_RIGHT(elm)) { elm = RB_RIGHT(elm); @@ -669,7 +669,7 @@ constexpr T* RB_NEXT(T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_PREV(T* elm) { if (RB_LEFT(elm)) { elm = RB_LEFT(elm); @@ -690,7 +690,7 @@ constexpr T* RB_PREV(T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_MIN(RBHead& head) { T* tmp = head.Root(); T* parent = nullptr; @@ -704,7 +704,7 @@ constexpr T* RB_MIN(RBHead& head) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_MAX(RBHead& head) { T* tmp = head.Root(); T* parent = nullptr; diff --git a/src/common/vector_math.h b/src/common/vector_math.h index 72b4e5a2a..95029615e 100755 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -348,9 +348,7 @@ public: // _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all // component names (x<->r) and permutations (xy<->yx) #define _DEFINE_SWIZZLER2(a, b, name) \ - [[nodiscard]] constexpr Vec2 name() const { \ - return Vec2(a, b); \ - } + [[nodiscard]] constexpr Vec2 name() const { return Vec2(a, b); } #define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \ _DEFINE_SWIZZLER2(a, b, a##b); \ _DEFINE_SWIZZLER2(a, b, a2##b2); \ @@ -543,9 +541,7 @@ public: // DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and // permutations (xy<->yx) #define _DEFINE_SWIZZLER2(a, b, name) \ - [[nodiscard]] constexpr Vec2 name() const { \ - return Vec2(a, b); \ - } + [[nodiscard]] constexpr Vec2 name() const { return Vec2(a, b); } #define DEFINE_SWIZZLER2_COMP1(a, a2) \ _DEFINE_SWIZZLER2(a, a, a##a); \ _DEFINE_SWIZZLER2(a, a, a2##a2) @@ -570,9 +566,7 @@ public: #undef _DEFINE_SWIZZLER2 #define _DEFINE_SWIZZLER3(a, b, c, name) \ - [[nodiscard]] constexpr Vec3 name() const { \ - return Vec3(a, b, c); \ - } + [[nodiscard]] constexpr Vec3 name() const { return Vec3(a, b, c); } #define DEFINE_SWIZZLER3_COMP1(a, a2) \ _DEFINE_SWIZZLER3(a, a, a, a##a##a); \ _DEFINE_SWIZZLER3(a, a, a, a2##a2##a2) @@ -641,8 +635,8 @@ template // linear interpolation via float: 0.0=begin, 1.0=end template -[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) - Lerp(const X& begin, const X& end, const float t) { +[[nodiscard]] constexpr decltype(X{} * float{} + X{} * float{}) Lerp(const X& begin, const X& end, + const float t) { return begin * (1.f - t) + end * t; } diff --git a/src/core/hle/kernel/k_auto_object.h b/src/core/hle/kernel/k_auto_object.h index f44e890c8..34423219a 100755 --- a/src/core/hle/kernel/k_auto_object.h +++ b/src/core/hle/kernel/k_auto_object.h @@ -24,9 +24,7 @@ private: friend class ::Kernel::KClassTokenGenerator; \ static constexpr inline auto ObjectType = ::Kernel::KClassTokenGenerator::ObjectType::CLASS; \ static constexpr inline const char* const TypeName = #CLASS; \ - static constexpr inline ClassTokenType ClassToken() { \ - return ::Kernel::ClassToken; \ - } \ + static constexpr inline ClassTokenType ClassToken() { return ::Kernel::ClassToken; } \ \ public: \ YUZU_NON_COPYABLE(CLASS); \ @@ -37,15 +35,9 @@ public: constexpr ClassTokenType Token = ClassToken(); \ return TypeObj(TypeName, Token); \ } \ - static constexpr const char* GetStaticTypeName() { \ - return TypeName; \ - } \ - virtual TypeObj GetTypeObj() ATTRIBUTE { \ - return GetStaticTypeObj(); \ - } \ - virtual const char* GetTypeName() ATTRIBUTE { \ - return GetStaticTypeName(); \ - } \ + static constexpr const char* GetStaticTypeName() { return TypeName; } \ + virtual TypeObj GetTypeObj() ATTRIBUTE { return GetStaticTypeObj(); } \ + virtual const char* GetTypeName() ATTRIBUTE { return GetStaticTypeName(); } \ \ private: \ constexpr bool operator!=(const TypeObj& rhs) @@ -245,8 +237,8 @@ public: } template - requires(std::derived_from || - std::derived_from) constexpr KScopedAutoObject(KScopedAutoObject&& rhs) { + requires(std::derived_from || std::derived_from) + constexpr KScopedAutoObject(KScopedAutoObject&& rhs) { if constexpr (std::derived_from) { // Upcast. m_obj = rhs.m_obj; diff --git a/src/core/hle/kernel/k_capabilities.cpp b/src/core/hle/kernel/k_capabilities.cpp index 60afdc8f1..64f1d7371 100755 --- a/src/core/hle/kernel/k_capabilities.cpp +++ b/src/core/hle/kernel/k_capabilities.cpp @@ -112,7 +112,7 @@ Result KCapabilities::SetSyscallMaskCapability(const u32 cap, u32& set_svc) { // Set SVCs. for (size_t i = 0; i < decltype(SyscallMask::mask)::bits; i++) { - const u32 svc_id = static_cast(decltype(SyscallMask::mask)::bits* index + i); + const u32 svc_id = static_cast(decltype(SyscallMask::mask)::bits * index + i); if (mask & (1U << i)) { R_UNLESS(this->SetSvcAllowed(svc_id), ResultOutOfRange); } diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index ed5363619..3c263912b 100755 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h @@ -17,35 +17,41 @@ namespace Kernel { class KThread; template -concept KPriorityQueueAffinityMask = !std::is_reference_v && requires(T & t) { - { t.GetAffinityMask() } -> Common::ConvertibleTo; - {t.SetAffinityMask(0)}; +concept KPriorityQueueAffinityMask = ! +std::is_reference_v&& requires(T& t) { + { t.GetAffinityMask() } -> Common::ConvertibleTo; + { t.SetAffinityMask(0) }; - { t.GetAffinity(0) } -> std::same_as; - {t.SetAffinity(0, false)}; - {t.SetAll()}; -}; + { t.GetAffinity(0) } -> std::same_as; + { t.SetAffinity(0, false) }; + { t.SetAll() }; + }; template -concept KPriorityQueueMember = !std::is_reference_v && requires(T & t) { - {typename T::QueueEntry()}; - {(typename T::QueueEntry()).Initialize()}; - {(typename T::QueueEntry()).SetPrev(std::addressof(t))}; - {(typename T::QueueEntry()).SetNext(std::addressof(t))}; - { (typename T::QueueEntry()).GetNext() } -> std::same_as; - { (typename T::QueueEntry()).GetPrev() } -> std::same_as; - { t.GetPriorityQueueEntry(0) } -> std::same_as; +concept KPriorityQueueMember = ! +std::is_reference_v&& requires(T& t) { + { typename T::QueueEntry() }; + { (typename T::QueueEntry()).Initialize() }; + { (typename T::QueueEntry()).SetPrev(std::addressof(t)) }; + { (typename T::QueueEntry()).SetNext(std::addressof(t)) }; + { (typename T::QueueEntry()).GetNext() } -> std::same_as; + { (typename T::QueueEntry()).GetPrev() } -> std::same_as; + { + t.GetPriorityQueueEntry(0) + } -> std::same_as; - {t.GetAffinityMask()}; - { std::remove_cvref_t() } -> KPriorityQueueAffinityMask; + { t.GetAffinityMask() }; + { + std::remove_cvref_t() + } -> KPriorityQueueAffinityMask; - { t.GetActiveCore() } -> Common::ConvertibleTo; - { t.GetPriority() } -> Common::ConvertibleTo; - { t.IsDummyThread() } -> Common::ConvertibleTo; -}; + { t.GetActiveCore() } -> Common::ConvertibleTo; + { t.GetPriority() } -> Common::ConvertibleTo; + { t.IsDummyThread() } -> Common::ConvertibleTo; + }; template -requires KPriorityQueueMember + requires KPriorityQueueMember class KPriorityQueue { public: using AffinityMaskType = std::remove_cv_t< diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h index a78e1fa51..a8e33f25c 100755 --- a/src/core/hle/kernel/k_scoped_lock.h +++ b/src/core/hle/kernel/k_scoped_lock.h @@ -9,13 +9,14 @@ namespace Kernel { template -concept KLockable = !std::is_reference_v && requires(T & t) { - { t.Lock() } -> std::same_as; - { t.Unlock() } -> std::same_as; -}; +concept KLockable = ! +std::is_reference_v&& requires(T& t) { + { t.Lock() } -> std::same_as; + { t.Unlock() } -> std::same_as; + }; template -requires KLockable + requires KLockable class [[nodiscard]] KScopedLock { public: explicit KScopedLock(T* l) : lock_ptr(l) { diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index 4e4869840..f357e6236 100755 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h @@ -677,7 +677,7 @@ private: union SyncObjectBuffer { std::array sync_objects{}; std::array + Svc::ArgumentHandleCountMax * (sizeof(KSynchronizationObject*) / sizeof(Handle))> handles; constexpr SyncObjectBuffer() {} }; @@ -698,10 +698,8 @@ private: }; template - requires( - std::same_as || - std::same_as) static constexpr int Compare(const T& lhs, - const KThread& rhs) { + requires(std::same_as || std::same_as) + static constexpr int Compare(const T& lhs, const KThread& rhs) { const u64 l_key = lhs.GetConditionVariableKey(); const u64 r_key = rhs.GetConditionVariableKey(); diff --git a/src/core/hle/kernel/k_thread_local_page.h b/src/core/hle/kernel/k_thread_local_page.h index 07ff1fc3a..41c9c8a76 100755 --- a/src/core/hle/kernel/k_thread_local_page.h +++ b/src/core/hle/kernel/k_thread_local_page.h @@ -70,10 +70,8 @@ public: } template - requires(std::same_as || - std::same_as) static constexpr int Compare(const T& lhs, - const KThreadLocalPage& - rhs) { + requires(std::same_as || std::same_as) + static constexpr int Compare(const T& lhs, const KThreadLocalPage& rhs) { const VAddr lval = GetRedBlackKey(lhs); const VAddr rval = GetRedBlackKey(rhs); diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.h b/src/input_common/helpers/joycon_protocol/common_protocol.h index 0860f2422..f44f73ba4 100755 --- a/src/input_common/helpers/joycon_protocol/common_protocol.h +++ b/src/input_common/helpers/joycon_protocol/common_protocol.h @@ -60,7 +60,8 @@ public: DriverResult SendRawData(std::span buffer); template - requires std::is_trivially_copyable_v DriverResult SendData(const Output& output) { + requires std::is_trivially_copyable_v + DriverResult SendData(const Output& output) { std::array buffer; std::memcpy(buffer.data(), &output, sizeof(Output)); return SendRawData(buffer); @@ -115,8 +116,8 @@ public: * @returns output object containing the response */ template - requires std::is_trivially_copyable_v DriverResult ReadSPI(SpiAddress addr, - Output& output) { + requires std::is_trivially_copyable_v + DriverResult ReadSPI(SpiAddress addr, Output& output) { std::array buffer; output = {}; diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index e59c2d64e..a40934e32 100755 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp @@ -59,6 +59,13 @@ std::string Image(EmitContext& ctx, IR::TextureInstInfo info, } } +bool IsTextureMsaa(EmitContext& ctx, const IR::TextureInstInfo& info) { + if (info.type == TextureType::Buffer) { + return false; + } + return ctx.info.texture_descriptors.at(info.descriptor_index).is_multisample; +} + std::string_view TextureType(IR::TextureInstInfo info, bool is_ms = false) { if (info.is_depth) { switch (info.type) { @@ -535,7 +542,8 @@ void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& ScalarS32 lod, [[maybe_unused]] const IR::Value& skip_mips) { const auto info{inst.Flags()}; const std::string texture{Texture(ctx, info, index)}; - const std::string_view type{TextureType(info)}; + const bool is_msaa{IsTextureMsaa(ctx, info)}; + const std::string_view type{TextureType(info, is_msaa)}; ctx.Add("TXQ {},{},{},{};", inst, lod, texture, type); } diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp index 18b39b956..8e48caa26 100755 --- a/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_image.cpp @@ -25,6 +25,13 @@ std::string Image(EmitContext& ctx, const IR::TextureInstInfo& info, const IR::V return fmt::format("img{}{}", def.binding, index_offset); } +bool IsTextureMsaa(EmitContext& ctx, const IR::TextureInstInfo& info) { + if (info.type == TextureType::Buffer) { + return false; + } + return ctx.info.texture_descriptors.at(info.descriptor_index).is_multisample; +} + std::string CastToIntVec(std::string_view value, const IR::TextureInstInfo& info) { switch (info.type) { case TextureType::Color1D: @@ -463,26 +470,33 @@ void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& std::string_view lod, const IR::Value& skip_mips_val) { const auto info{inst.Flags()}; const auto texture{Texture(ctx, info, index)}; + const bool is_msaa{IsTextureMsaa(ctx, info)}; const bool skip_mips{skip_mips_val.U1()}; - const auto mips{ - [&] { return skip_mips ? "0u" : fmt::format("uint(textureQueryLevels({}))", texture); }}; + const auto mips{skip_mips ? "0u" : fmt::format("uint(textureQueryLevels({}))", texture)}; + if (is_msaa && !skip_mips) { + throw NotImplementedException("EmitImageQueryDimensions MSAA QueryLevels"); + } + if (info.type == TextureType::Buffer && !skip_mips) { + throw NotImplementedException("EmitImageQueryDimensions TextureType::Buffer QueryLevels"); + } + const bool uses_lod{!is_msaa && info.type != TextureType::Buffer}; + const auto lod_str{uses_lod ? fmt::format(",int({})", lod) : ""}; switch (info.type) { case TextureType::Color1D: - return ctx.AddU32x4("{}=uvec4(uint(textureSize({},int({}))),0u,0u,{});", inst, texture, lod, - mips()); + return ctx.AddU32x4("{}=uvec4(uint(textureSize({}{})),0u,0u,{});", inst, texture, lod_str, + mips); case TextureType::ColorArray1D: case TextureType::Color2D: case TextureType::ColorCube: case TextureType::Color2DRect: - return ctx.AddU32x4("{}=uvec4(uvec2(textureSize({},int({}))),0u,{});", inst, texture, lod, - mips()); + return ctx.AddU32x4("{}=uvec4(uvec2(textureSize({}{})),0u,{});", inst, texture, lod_str, + mips); case TextureType::ColorArray2D: case TextureType::Color3D: case TextureType::ColorArrayCube: - return ctx.AddU32x4("{}=uvec4(uvec3(textureSize({},int({}))),{});", inst, texture, lod, - mips()); + return ctx.AddU32x4("{}=uvec4(uvec3(textureSize({}{})),{});", inst, texture, lod_str, mips); case TextureType::Buffer: - throw NotImplementedException("EmitImageQueryDimensions Texture buffers"); + return ctx.AddU32x4("{}=uvec4(uint(textureSize({})),0u,0u,{});", inst, texture, mips); } throw LogicError("Unspecified image type {}", info.type.Value()); } diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index e68a6169e..7c23654b6 100755 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -201,6 +201,13 @@ Id Image(EmitContext& ctx, const IR::Value& index, IR::TextureInstInfo info) { } } +bool IsTextureMsaa(EmitContext& ctx, const IR::TextureInstInfo& info) { + if (info.type == TextureType::Buffer) { + return false; + } + return ctx.textures.at(info.descriptor_index).is_multisample; +} + Id Decorate(EmitContext& ctx, IR::Inst* inst, Id sample) { const auto info{inst->Flags()}; if (info.relaxed_precision != 0) { @@ -452,24 +459,26 @@ Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& i const Id zero{ctx.u32_zero_value}; const bool skip_mips{skip_mips_val.U1()}; const auto mips{[&] { return skip_mips ? zero : ctx.OpImageQueryLevels(ctx.U32[1], image); }}; + const bool is_msaa{IsTextureMsaa(ctx, info)}; + const bool uses_lod{!is_msaa && info.type != TextureType::Buffer}; + const auto query{[&](Id type) { + return uses_lod ? ctx.OpImageQuerySizeLod(type, image, lod) + : ctx.OpImageQuerySize(type, image); + }}; switch (info.type) { case TextureType::Color1D: - return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySizeLod(ctx.U32[1], image, lod), - zero, zero, mips()); + return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[1]), zero, zero, mips()); case TextureType::ColorArray1D: case TextureType::Color2D: case TextureType::ColorCube: case TextureType::Color2DRect: - return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySizeLod(ctx.U32[2], image, lod), - zero, mips()); + return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[2]), zero, mips()); case TextureType::ColorArray2D: case TextureType::Color3D: case TextureType::ColorArrayCube: - return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySizeLod(ctx.U32[3], image, lod), - mips()); + return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[3]), mips()); case TextureType::Buffer: - return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySize(ctx.U32[1], image), zero, - zero, mips()); + return ctx.OpCompositeConstruct(ctx.U32[4], query(ctx.U32[1]), zero, zero, mips()); } throw LogicError("Unspecified image type {}", info.type.Value()); } diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index fb2c33529..b2b89f505 100755 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -1288,6 +1288,7 @@ void EmitContext::DefineTextures(const Info& info, u32& binding, u32& scaling_in .pointer_type = pointer_type, .image_type = image_type, .count = desc.count, + .is_multisample = desc.is_multisample, }); if (profile.supported_spirv >= 0x00010400) { interfaces.push_back(id); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index 6e1daab15..0262af1e4 100755 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -35,6 +35,7 @@ struct TextureDefinition { Id pointer_type; Id image_type; u32 count; + bool is_multisample; }; struct TextureBufferDefinition { diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index c94eef89b..9a6c35809 100755 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h @@ -409,7 +409,8 @@ private: } template - requires(sizeof(T) <= sizeof(u32) && std::is_trivially_copyable_v) struct Flags { + requires(sizeof(T) <= sizeof(u32) && std::is_trivially_copyable_v) + struct Flags { Flags() = default; Flags(T proxy_) : proxy{proxy_} {} diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h index 333ec2539..0cc585bbd 100755 --- a/src/shader_recompiler/frontend/ir/value.h +++ b/src/shader_recompiler/frontend/ir/value.h @@ -101,9 +101,8 @@ public: TypedValue() = default; template - requires((other_type & type_) != IR::Type::Void) explicit(false) - TypedValue(const TypedValue& value) - : Value(value) {} + requires((other_type & type_) != IR::Type::Void) + explicit(false) TypedValue(const TypedValue& value) : Value(value) {} explicit TypedValue(const Value& value) : Value(value) { if ((value.Type() & type_) == IR::Type::Void) { @@ -194,16 +193,16 @@ public: void ReplaceOpcode(IR::Opcode opcode); template - requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v) - [[nodiscard]] FlagsType Flags() const noexcept { + requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v) + [[nodiscard]] FlagsType Flags() const noexcept { FlagsType ret; std::memcpy(reinterpret_cast(&ret), &flags, sizeof(ret)); return ret; } template - requires(sizeof(FlagsType) <= sizeof(u32) && - std::is_trivially_copyable_v) void SetFlags(FlagsType value) noexcept { + requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v) + void SetFlags(FlagsType value) noexcept { std::memcpy(&flags, &value, sizeof(value)); } diff --git a/src/shader_recompiler/object_pool.h b/src/shader_recompiler/object_pool.h index 48bd5d84b..a29b0822d 100755 --- a/src/shader_recompiler/object_pool.h +++ b/src/shader_recompiler/object_pool.h @@ -10,7 +10,7 @@ namespace Shader { template -requires std::is_destructible_v + requires std::is_destructible_v class ObjectPool { public: explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { @@ -18,7 +18,7 @@ public: } template - requires std::is_constructible_v + requires std::is_constructible_v [[nodiscard]] T* Create(Args&&... args) { return std::construct_at(Memory(), std::forward(args)...); } diff --git a/src/video_core/texture_cache/descriptor_table.h b/src/video_core/texture_cache/descriptor_table.h index ba3df2bfe..8fde25b29 100755 --- a/src/video_core/texture_cache/descriptor_table.h +++ b/src/video_core/texture_cache/descriptor_table.h @@ -19,9 +19,7 @@ public: explicit DescriptorTable(Tegra::MemoryManager& gpu_memory_) : gpu_memory{gpu_memory_} {} [[nodiscard]] bool Synchronize(GPUVAddr gpu_addr, u32 limit) { - [[likely]] if (current_gpu_addr == gpu_addr && current_limit == limit) { - return false; - } + [[likely]] if (current_gpu_addr == gpu_addr && current_limit == limit) { return false; } Refresh(gpu_addr, limit); return true; } diff --git a/src/video_core/texture_cache/slot_vector.h b/src/video_core/texture_cache/slot_vector.h index 1474a5211..bdc8403ff 100755 --- a/src/video_core/texture_cache/slot_vector.h +++ b/src/video_core/texture_cache/slot_vector.h @@ -29,7 +29,7 @@ struct SlotId { }; template -requires std::is_nothrow_move_assignable_v && std::is_nothrow_move_constructible_v + requires std::is_nothrow_move_assignable_v && std::is_nothrow_move_constructible_v class SlotVector { public: class Iterator {