summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/frontend/ir/value.h')
-rw-r--r--src/shader_recompiler/frontend/ir/value.h13
1 files changed, 6 insertions, 7 deletions
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