summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2019-11-13 02:16:22 -0300
committerGravatar GitHub2019-11-13 02:16:22 -0300
commitcf770a68a528cdb7f3a5483f6d17eeb924e37b7e (patch)
tree6406933e26e9fbe255a04b4c0810d21b05815494 /src/video_core/engines
parentUpdate CONTRIBUTING.md (diff)
parentvideo_core: Enable sign conversion warnings (diff)
downloadyuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.gz
yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.tar.xz
yuzu-cf770a68a528cdb7f3a5483f6d17eeb924e37b7e.zip
Merge pull request #3084 from ReinUsesLisp/cast-warnings
video_core: Treat implicit conversions as errors
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp3
-rw-r--r--src/video_core/engines/shader_bytecode.h12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 2bed6cb38..42ce49a4d 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -261,7 +261,8 @@ void Maxwell3D::CallMacroMethod(u32 method, std::size_t num_parameters, const u3
261 executing_macro = 0; 261 executing_macro = 0;
262 262
263 // Lookup the macro offset 263 // Lookup the macro offset
264 const u32 entry = ((method - MacroRegistersStart) >> 1) % macro_positions.size(); 264 const u32 entry =
265 ((method - MacroRegistersStart) >> 1) % static_cast<u32>(macro_positions.size());
265 266
266 // Execute the current macro. 267 // Execute the current macro.
267 macro_interpreter.Execute(macro_positions[entry], num_parameters, parameters); 268 macro_interpreter.Execute(macro_positions[entry], num_parameters, parameters);
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 {
1478 u32 value = static_cast<u32>(target); 1478 u32 value = static_cast<u32>(target);
1479 // The branch offset is relative to the next instruction and is stored in bytes, so 1479 // The branch offset is relative to the next instruction and is stored in bytes, so
1480 // divide it by the size of an instruction and add 1 to it. 1480 // divide it by the size of an instruction and add 1 to it.
1481 return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1; 1481 return static_cast<s32>((value ^ mask) - mask) / static_cast<s32>(sizeof(Instruction)) +
1482 1;
1482 } 1483 }
1483 } bra; 1484 } bra;
1484 1485
@@ -1492,7 +1493,8 @@ union Instruction {
1492 u32 value = static_cast<u32>(target); 1493 u32 value = static_cast<u32>(target);
1493 // The branch offset is relative to the next instruction and is stored in bytes, so 1494 // The branch offset is relative to the next instruction and is stored in bytes, so
1494 // divide it by the size of an instruction and add 1 to it. 1495 // divide it by the size of an instruction and add 1 to it.
1495 return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1; 1496 return static_cast<s32>((value ^ mask) - mask) / static_cast<s32>(sizeof(Instruction)) +
1497 1;
1496 } 1498 }
1497 } brx; 1499 } brx;
1498 1500
@@ -1851,11 +1853,11 @@ private:
1851 const std::size_t bit_position = opcode_bitsize - i - 1; 1853 const std::size_t bit_position = opcode_bitsize - i - 1;
1852 switch (bitstring[i]) { 1854 switch (bitstring[i]) {
1853 case '0': 1855 case '0':
1854 mask |= 1 << bit_position; 1856 mask |= static_cast<u16>(1U << bit_position);
1855 break; 1857 break;
1856 case '1': 1858 case '1':
1857 expect |= 1 << bit_position; 1859 expect |= static_cast<u16>(1U << bit_position);
1858 mask |= 1 << bit_position; 1860 mask |= static_cast<u16>(1U << bit_position);
1859 break; 1861 break;
1860 default: 1862 default:
1861 // Ignore 1863 // Ignore