summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_ir.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-12-21 07:13:05 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-01-15 21:54:52 +0100
commitd4fae3a69972fe9685b6b4f1b3c272fc2558d681 (patch)
tree62d95bc38c04923006846413c9947522fbdb1b15 /src/video_core/shader/shader_ir.h
parentshader_decode: Fixup clang-format (diff)
downloadyuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar.gz
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar.bz2
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar.lz
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar.xz
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.tar.zst
yuzu-d4fae3a69972fe9685b6b4f1b3c272fc2558d681.zip
Diffstat (limited to 'src/video_core/shader/shader_ir.h')
-rw-r--r--src/video_core/shader/shader_ir.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index b91ef246f..8ad2a366f 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -4,6 +4,7 @@
#pragma once
+#include <cstring>
#include <map>
#include <set>
#include <string>
@@ -606,8 +607,9 @@ private:
}
/// Creates a f32 immediate
Node Immediate(f32 value) {
- // TODO(Rodrigo): Replace this with bit_cast when C++20 releases
- return Immediate(*reinterpret_cast<const u32*>(&value));
+ u32 integral;
+ std::memcpy(&integral, &value, sizeof(u32));
+ return Immediate(integral);
}
/// Generates a node for a passed register.