summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar bunnei2014-12-22 00:12:43 -0500
committerGravatar bunnei2014-12-22 00:12:43 -0500
commit2188af4a653d56fcaf59e90399beb2c355762140 (patch)
treeb9c5bf92b6cebe6ecb7de4685049afdbc54d839d /src/video_core
parentMerge pull request #325 from yuriks/cmake-opts (diff)
parentMore warning cleanups (diff)
downloadyuzu-2188af4a653d56fcaf59e90399beb2c355762140.tar.gz
yuzu-2188af4a653d56fcaf59e90399beb2c355762140.tar.xz
yuzu-2188af4a653d56fcaf59e90399beb2c355762140.zip
Merge pull request #322 from chinhodado/master
More warning cleanups
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/command_processor.cpp4
-rw-r--r--src/video_core/pica.h10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index ea29e5027..2083357fe 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -90,7 +90,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
90 const auto& index_info = registers.index_array; 90 const auto& index_info = registers.index_array;
91 const u8* index_address_8 = Memory::GetPointer(PAddrToVAddr(base_address + index_info.offset)); 91 const u8* index_address_8 = Memory::GetPointer(PAddrToVAddr(base_address + index_info.offset));
92 const u16* index_address_16 = (u16*)index_address_8; 92 const u16* index_address_16 = (u16*)index_address_8;
93 bool index_u16 = (bool)index_info.format; 93 bool index_u16 = index_info.format != 0;
94 94
95 DebugUtils::GeometryDumper geometry_dumper; 95 DebugUtils::GeometryDumper geometry_dumper;
96 PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value()); 96 PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value());
@@ -164,7 +164,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
164 164
165 case PICA_REG_INDEX(vs_bool_uniforms): 165 case PICA_REG_INDEX(vs_bool_uniforms):
166 for (unsigned i = 0; i < 16; ++i) 166 for (unsigned i = 0; i < 16; ++i)
167 VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i)); 167 VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i)) != 0;
168 168
169 break; 169 break;
170 170
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 1fac9ff36..89d97e4e9 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -201,9 +201,9 @@ struct Regs {
201 }; 201 };
202 const std::array<FullTextureConfig, 3> GetTextures() const { 202 const std::array<FullTextureConfig, 3> GetTextures() const {
203 return {{ 203 return {{
204 { static_cast<bool>(texture0_enable), texture0, texture0_format }, 204 { texture0_enable.ToBool(), texture0, texture0_format },
205 { static_cast<bool>(texture1_enable), texture1, texture1_format }, 205 { texture1_enable.ToBool(), texture1, texture1_format },
206 { static_cast<bool>(texture2_enable), texture2, texture2_format } 206 { texture2_enable.ToBool(), texture2, texture2_format }
207 }}; 207 }};
208 } 208 }
209 209
@@ -590,11 +590,11 @@ struct Regs {
590 static std::string GetCommandName(int index) { 590 static std::string GetCommandName(int index) {
591 std::map<u32, std::string> map; 591 std::map<u32, std::string> map;
592 592
593 Regs regs;
594 #define ADD_FIELD(name) \ 593 #define ADD_FIELD(name) \
595 do { \ 594 do { \
596 map.insert({PICA_REG_INDEX(name), #name}); \ 595 map.insert({PICA_REG_INDEX(name), #name}); \
597 for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(regs.name) / 4; ++i) \ 596 /* TODO: change to Regs::name when VS2015 and other compilers support it */ \
597 for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \
598 map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ 598 map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \
599 } while(false) 599 } while(false)
600 600