diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/file_util.cpp | 6 | ||||
| -rw-r--r-- | src/common/file_util.h | 14 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 7 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index cd852bfd8..2d0b81c6e 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -809,16 +809,16 @@ IOFile::~IOFile() { | |||
| 809 | Close(); | 809 | Close(); |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | IOFile::IOFile(IOFile&& other) { | 812 | IOFile::IOFile(IOFile&& other) noexcept { |
| 813 | Swap(other); | 813 | Swap(other); |
| 814 | } | 814 | } |
| 815 | 815 | ||
| 816 | IOFile& IOFile::operator=(IOFile&& other) { | 816 | IOFile& IOFile::operator=(IOFile&& other) noexcept { |
| 817 | Swap(other); | 817 | Swap(other); |
| 818 | return *this; | 818 | return *this; |
| 819 | } | 819 | } |
| 820 | 820 | ||
| 821 | void IOFile::Swap(IOFile& other) { | 821 | void IOFile::Swap(IOFile& other) noexcept { |
| 822 | std::swap(m_file, other.m_file); | 822 | std::swap(m_file, other.m_file); |
| 823 | std::swap(m_good, other.m_good); | 823 | std::swap(m_good, other.m_good); |
| 824 | } | 824 | } |
diff --git a/src/common/file_util.h b/src/common/file_util.h index 4c11849ee..fc6b3ea46 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h | |||
| @@ -160,10 +160,10 @@ public: | |||
| 160 | 160 | ||
| 161 | ~IOFile(); | 161 | ~IOFile(); |
| 162 | 162 | ||
| 163 | IOFile(IOFile&& other); | 163 | IOFile(IOFile&& other) noexcept; |
| 164 | IOFile& operator=(IOFile&& other); | 164 | IOFile& operator=(IOFile&& other) noexcept; |
| 165 | 165 | ||
| 166 | void Swap(IOFile& other); | 166 | void Swap(IOFile& other) noexcept; |
| 167 | 167 | ||
| 168 | bool Open(const std::string& filename, const char openmode[]); | 168 | bool Open(const std::string& filename, const char openmode[]); |
| 169 | bool Close(); | 169 | bool Close(); |
| @@ -202,11 +202,15 @@ public: | |||
| 202 | return items_written; | 202 | return items_written; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | size_t ReadBytes(void* data, size_t length) { | 205 | template <typename T> |
| 206 | size_t ReadBytes(T* data, size_t length) { | ||
| 207 | static_assert(std::is_trivially_copyable<T>(), "T must be trivially copyable"); | ||
| 206 | return ReadArray(reinterpret_cast<char*>(data), length); | 208 | return ReadArray(reinterpret_cast<char*>(data), length); |
| 207 | } | 209 | } |
| 208 | 210 | ||
| 209 | size_t WriteBytes(const void* data, size_t length) { | 211 | template <typename T> |
| 212 | size_t WriteBytes(const T* data, size_t length) { | ||
| 213 | static_assert(std::is_trivially_copyable<T>(), "T must be trivially copyable"); | ||
| 210 | return WriteArray(reinterpret_cast<const char*>(data), length); | 214 | return WriteArray(reinterpret_cast<const char*>(data), length); |
| 211 | } | 215 | } |
| 212 | 216 | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 539aa87f9..abbf0893d 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -888,6 +888,9 @@ private: | |||
| 888 | case PredCondition::Equal: | 888 | case PredCondition::Equal: |
| 889 | SetPredicate(instr.fsetp.pred3, '(' + op_a + ") == (" + op_b + ')'); | 889 | SetPredicate(instr.fsetp.pred3, '(' + op_a + ") == (" + op_b + ')'); |
| 890 | break; | 890 | break; |
| 891 | case PredCondition::LessEqual: | ||
| 892 | SetPredicate(instr.fsetp.pred3, '(' + op_a + ") <= (" + op_b + ')'); | ||
| 893 | break; | ||
| 891 | default: | 894 | default: |
| 892 | NGLOG_CRITICAL(HW_GPU, "Unhandled predicate condition: {} (a: {}, b: {})", | 895 | NGLOG_CRITICAL(HW_GPU, "Unhandled predicate condition: {} (a: {}, b: {})", |
| 893 | static_cast<unsigned>(instr.fsetp.cond.Value()), op_a, op_b); | 896 | static_cast<unsigned>(instr.fsetp.cond.Value()), op_a, op_b); |
| @@ -939,6 +942,10 @@ private: | |||
| 939 | regs.SetRegisterToFloat(instr.gpr0, 0, | 942 | regs.SetRegisterToFloat(instr.gpr0, 0, |
| 940 | "((" + op_a + ") == (" + op_b + ")) ? 1.0 : 0", 1, 1); | 943 | "((" + op_a + ") == (" + op_b + ")) ? 1.0 : 0", 1, 1); |
| 941 | break; | 944 | break; |
| 945 | case PredCondition::LessEqual: | ||
| 946 | regs.SetRegisterToFloat(instr.gpr0, 0, | ||
| 947 | "((" + op_a + ") <= (" + op_b + ")) ? 1.0 : 0", 1, 1); | ||
| 948 | break; | ||
| 942 | case PredCondition::GreaterThan: | 949 | case PredCondition::GreaterThan: |
| 943 | regs.SetRegisterToFloat(instr.gpr0, 0, | 950 | regs.SetRegisterToFloat(instr.gpr0, 0, |
| 944 | "((" + op_a + ") > (" + op_b + ")) ? 1.0 : 0", 1, 1); | 951 | "((" + op_a + ") > (" + op_b + ")) ? 1.0 : 0", 1, 1); |