diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2019-11-13 06:16:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-13 06:16:22 +0100 |
commit | cf770a68a528cdb7f3a5483f6d17eeb924e37b7e (patch) | |
tree | 6406933e26e9fbe255a04b4c0810d21b05815494 /src/video_core/engines/shader_bytecode.h | |
parent | Update CONTRIBUTING.md (diff) | |
parent | video_core: Enable sign conversion warnings (diff) | |
download | yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.gz yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.bz2 yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.lz yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.xz yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.zst yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.zip |
Diffstat (limited to 'src/video_core/engines/shader_bytecode.h')
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 8f6bc76eb..78d6886fb 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -1478,7 +1478,8 @@ union Instruction { u32 value = static_cast<u32>(target); // The branch offset is relative to the next instruction and is stored in bytes, so // divide it by the size of an instruction and add 1 to it. - return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1; + return static_cast<s32>((value ^ mask) - mask) / static_cast<s32>(sizeof(Instruction)) + + 1; } } bra; @@ -1492,7 +1493,8 @@ union Instruction { u32 value = static_cast<u32>(target); // The branch offset is relative to the next instruction and is stored in bytes, so // divide it by the size of an instruction and add 1 to it. - return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1; + return static_cast<s32>((value ^ mask) - mask) / static_cast<s32>(sizeof(Instruction)) + + 1; } } brx; @@ -1851,11 +1853,11 @@ private: const std::size_t bit_position = opcode_bitsize - i - 1; switch (bitstring[i]) { case '0': - mask |= 1 << bit_position; + mask |= static_cast<u16>(1U << bit_position); break; case '1': - expect |= 1 << bit_position; - mask |= 1 << bit_position; + expect |= static_cast<u16>(1U << bit_position); + mask |= static_cast<u16>(1U << bit_position); break; default: // Ignore |