summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-08 01:27:12 -0400
committerGravatar bunnei2018-08-08 01:45:23 -0400
commite542356d0cc37b61621da8d2b376d32407ec8eff (patch)
treeff3035337894e3e00320dea96754a24ef3562ea7 /src/video_core/engines
parentMerge pull request #964 from Hexagon12/lower-logs (diff)
downloadyuzu-e542356d0cc37b61621da8d2b376d32407ec8eff.tar.gz
yuzu-e542356d0cc37b61621da8d2b376d32407ec8eff.tar.xz
yuzu-e542356d0cc37b61621da8d2b376d32407ec8eff.zip
gl_shader_decompiler: Let OpenGL interpret floats.
- Accuracy is lost in translation to string, e.g. with NaN. - Needed for Super Mario Odyssey.
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/shader_bytecode.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index c7e3fb4b1..0d33c5a5e 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -254,20 +254,15 @@ union Instruction {
254 BitField<56, 1, u64> invert_b; 254 BitField<56, 1, u64> invert_b;
255 } lop32i; 255 } lop32i;
256 256
257 float GetImm20_19() const { 257 u32 GetImm20_19() const {
258 float result{};
259 u32 imm{static_cast<u32>(imm20_19)}; 258 u32 imm{static_cast<u32>(imm20_19)};
260 imm <<= 12; 259 imm <<= 12;
261 imm |= negate_imm ? 0x80000000 : 0; 260 imm |= negate_imm ? 0x80000000 : 0;
262 std::memcpy(&result, &imm, sizeof(imm)); 261 return imm;
263 return result;
264 } 262 }
265 263
266 float GetImm20_32() const { 264 u32 GetImm20_32() const {
267 float result{}; 265 return static_cast<u32>(imm20_32);
268 s32 imm{static_cast<s32>(imm20_32)};
269 std::memcpy(&result, &imm, sizeof(imm));
270 return result;
271 } 266 }
272 267
273 s32 GetSignedImm20_20() const { 268 s32 GetSignedImm20_20() const {