aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/microinstruction.h
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-03-26 16:02:04 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:24 -0400
commit742d11c2ad948c8630be15901514ec9e5e5fcd20 (patch)
tree4d9e0976f8c95fbb5c8006b46579200315b04f0f /src/shader_recompiler/frontend/ir/microinstruction.h
parent981eb6f43bb88f1e57b4c657bf37cb7471a113e3 (diff)
shader: Implement TLD4.PTP
Diffstat (limited to 'src/shader_recompiler/frontend/ir/microinstruction.h')
-rw-r--r--src/shader_recompiler/frontend/ir/microinstruction.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.h b/src/shader_recompiler/frontend/ir/microinstruction.h
index 770bbd5506..77296cfa47 100644
--- a/src/shader_recompiler/frontend/ir/microinstruction.h
+++ b/src/shader_recompiler/frontend/ir/microinstruction.h
@@ -99,6 +99,12 @@ public:
return ret;
}
+ template <typename FlagsType>
+ requires(sizeof(FlagsType) <= sizeof(u32) && std::is_trivially_copyable_v<FlagsType>)
+ [[nodiscard]] void SetFlags(FlagsType& new_val) noexcept {
+ std::memcpy(&flags, &new_val, sizeof(new_val));
+ }
+
/// Intrusively store the host definition of this instruction.
template <typename DefinitionType>
void SetDefinition(DefinitionType def) {