summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorChin <chin.bimbo@gmail.com>2014-12-21 00:28:17 +0100
committerChin <chin.bimbo@gmail.com>2014-12-21 16:58:55 +0100
commit0199a7d9ef26516779f73192dd41738ce4116c20 (patch)
tree1b1529ae3d9e4e8e3d47d96893571a2eeb9fa4a2 /src/video_core
parentMerge pull request #316 from yuriks/thread-handle (diff)
downloadyuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.gz
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.bz2
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.lz
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.xz
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.tar.zst
yuzu-0199a7d9ef26516779f73192dd41738ce4116c20.zip
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 9b8ecf8e3..0cc95860d 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) {
const auto& index_info = registers.index_array;
const u8* index_address_8 = Memory::GetPointer(PAddrToVAddr(base_address + index_info.offset));
const u16* index_address_16 = (u16*)index_address_8;
- bool index_u16 = (bool)index_info.format;
+ bool index_u16 = index_info.format != 0;
DebugUtils::GeometryDumper geometry_dumper;
PrimitiveAssembler<VertexShader::OutputVertex> clipper_primitive_assembler(registers.triangle_topology.Value());
@@ -164,7 +164,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) {
case PICA_REG_INDEX(vs_bool_uniforms):
for (unsigned i = 0; i < 16; ++i)
- VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i));
+ VertexShader::GetBoolUniform(i) = (registers.vs_bool_uniforms.Value() & (1 << i)) != 0;
break;
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 06552a3ef..c98425f39 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -201,9 +201,9 @@ struct Regs {
};
const std::array<FullTextureConfig, 3> GetTextures() const {
return {{
- { static_cast<bool>(texture0_enable), texture0, texture0_format },
- { static_cast<bool>(texture1_enable), texture1, texture1_format },
- { static_cast<bool>(texture2_enable), texture2, texture2_format }
+ { texture0_enable.ToBool(), texture0, texture0_format },
+ { texture1_enable.ToBool(), texture1, texture1_format },
+ { texture2_enable.ToBool(), texture2, texture2_format }
}};
}
@@ -590,11 +590,11 @@ struct Regs {
static std::string GetCommandName(int index) {
std::map<u32, std::string> map;
- Regs regs;
#define ADD_FIELD(name) \
do { \
map.insert({PICA_REG_INDEX(name), #name}); \
- for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(regs.name) / 4; ++i) \
+ /* TODO: change to Regs::name when VS2015 and other compilers support it */ \
+ for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \
map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \
} while(false)