diff options
| author | 2023-01-29 13:54:13 -0700 | |
|---|---|---|
| committer | 2023-01-29 17:49:42 -0700 | |
| commit | d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea (patch) | |
| tree | 4bbcaee76bde35ddc6eff9a1c639866cf278b353 /src/shader_recompiler | |
| 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/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/ir_emitter.h | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/value.h | 13 | ||||
| -rw-r--r-- | src/shader_recompiler/object_pool.h | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/shader_recompiler/frontend/ir/ir_emitter.h b/src/shader_recompiler/frontend/ir/ir_emitter.h index df158c928..f3c81dbe1 100644 --- a/src/shader_recompiler/frontend/ir/ir_emitter.h +++ b/src/shader_recompiler/frontend/ir/ir_emitter.h | |||
| @@ -409,7 +409,8 @@ private: | |||
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | template <typename T> | 411 | template <typename T> |
| 412 | requires(sizeof(T) <= sizeof(u32) && std::is_trivially_copyable_v<T>) struct Flags { | 412 | requires(sizeof(T) <= sizeof(u32) && std::is_trivially_copyable_v<T>) |
| 413 | struct Flags { | ||
| 413 | Flags() = default; | 414 | Flags() = default; |
| 414 | Flags(T proxy_) : proxy{proxy_} {} | 415 | Flags(T proxy_) : proxy{proxy_} {} |
| 415 | 416 | ||
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h index 883dfa24e..22e89dd1b 100644 --- a/src/shader_recompiler/frontend/ir/value.h +++ b/src/shader_recompiler/frontend/ir/value.h | |||
| @@ -101,9 +101,8 @@ public: | |||
| 101 | TypedValue() = default; | 101 | TypedValue() = default; |
| 102 | 102 | ||
| 103 | template <IR::Type other_type> | 103 | template <IR::Type other_type> |
| 104 | requires((other_type & type_) != IR::Type::Void) explicit(false) | 104 | requires((other_type & type_) != IR::Type::Void) |
| 105 | TypedValue(const TypedValue<other_type>& value) | 105 | explicit(false) TypedValue(const TypedValue<other_type>& value) : Value(value) {} |
| 106 | : Value(value) {} | ||
| 107 | 106 | ||
| 108 | explicit TypedValue(const Value& value) : Value(value) { | 107 | explicit TypedValue(const Value& value) : Value(value) { |
| 109 | if ((value.Type() & type_) == IR::Type::Void) { | 108 | if ((value.Type() & type_) == IR::Type::Void) { |
| @@ -194,16 +193,16 @@ public: | |||
| 194 | void ReplaceOpcode(IR::Opcode opcode); | 193 | void ReplaceOpcode(IR::Opcode opcode); |
| 195 | 194 | ||
| 196 | template <typename FlagsType> | 195 | template <typename FlagsType> |
| 197 | requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v<FlagsType>) | 196 | requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v<FlagsType>) |
| 198 | [[nodiscard]] FlagsType Flags() const noexcept { | 197 | [[nodiscard]] FlagsType Flags() const noexcept { |
| 199 | FlagsType ret; | 198 | FlagsType ret; |
| 200 | std::memcpy(reinterpret_cast<char*>(&ret), &flags, sizeof(ret)); | 199 | std::memcpy(reinterpret_cast<char*>(&ret), &flags, sizeof(ret)); |
| 201 | return ret; | 200 | return ret; |
| 202 | } | 201 | } |
| 203 | 202 | ||
| 204 | template <typename FlagsType> | 203 | template <typename FlagsType> |
| 205 | requires(sizeof(FlagsType) <= sizeof(u32) && | 204 | requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v<FlagsType>) |
| 206 | std::is_trivially_copyable_v<FlagsType>) void SetFlags(FlagsType value) noexcept { | 205 | void SetFlags(FlagsType value) noexcept { |
| 207 | std::memcpy(&flags, &value, sizeof(value)); | 206 | std::memcpy(&flags, &value, sizeof(value)); |
| 208 | } | 207 | } |
| 209 | 208 | ||
diff --git a/src/shader_recompiler/object_pool.h b/src/shader_recompiler/object_pool.h index 2b42c4ba2..5d648b159 100644 --- a/src/shader_recompiler/object_pool.h +++ b/src/shader_recompiler/object_pool.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | namespace Shader { | 10 | namespace Shader { |
| 11 | 11 | ||
| 12 | template <typename T> | 12 | template <typename T> |
| 13 | requires std::is_destructible_v<T> | 13 | requires std::is_destructible_v<T> |
| 14 | class ObjectPool { | 14 | class ObjectPool { |
| 15 | public: | 15 | public: |
| 16 | explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { | 16 | explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { |
| @@ -18,7 +18,7 @@ public: | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | template <typename... Args> | 20 | template <typename... Args> |
| 21 | requires std::is_constructible_v<T, Args...> | 21 | requires std::is_constructible_v<T, Args...> |
| 22 | [[nodiscard]] T* Create(Args&&... args) { | 22 | [[nodiscard]] T* Create(Args&&... args) { |
| 23 | return std::construct_at(Memory(), std::forward<Args>(args)...); | 23 | return std::construct_at(Memory(), std::forward<Args>(args)...); |
| 24 | } | 24 | } |