diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-25 21:50:32 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-25 21:50:32 +0200 |
commit | 9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1 (patch) | |
tree | 732bc1b978397a05fab07d5443fe05534ea39b37 /src/video_core | |
parent | Merge pull request #981 from Subv/checkboxes (diff) | |
parent | Vertex Shader : Undo casting (diff) | |
download | yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.gz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.bz2 yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.lz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.xz yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.tar.zst yuzu-9a0f9f12cd867c8fa033fa8e5e564bda2eaf2db1.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/command_processor.cpp | 2 | ||||
-rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 32 | ||||
-rw-r--r-- | src/video_core/pica.h | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 92ba8754f..43ae06181 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -103,7 +103,7 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): { - unsigned index = id - PICA_REG_INDEX(command_buffer.trigger[0]); + unsigned index = static_cast<unsigned>(id - PICA_REG_INDEX(command_buffer.trigger[0])); u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index d24c0f11e..fc9faffc3 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -85,7 +85,7 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) { vertices.push_back(v1); vertices.push_back(v2); - int num_vertices = vertices.size(); + size_t num_vertices = vertices.size(); faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); } @@ -241,8 +241,8 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data dvle.main_offset_words = main_offset; dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; - dvle.output_register_table_size = output_info_table.size(); - QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo)); + dvle.output_register_table_size = static_cast<uint32_t>(output_info_table.size()); + QueueForWriting((u8*)output_info_table.data(), static_cast<u32>(output_info_table.size() * sizeof(OutputRegisterInfo))); // TODO: Create a label table for "main" @@ -497,31 +497,31 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture // Lookup base value Math::Vec3<int> ret; if (differential_mode) { - ret.r() = differential.r; - ret.g() = differential.g; - ret.b() = differential.b; + ret.r() = static_cast<int>(differential.r); + ret.g() = static_cast<int>(differential.g); + ret.b() = static_cast<int>(differential.b); if (x >= 2) { - ret.r() += differential.dr; - ret.g() += differential.dg; - ret.b() += differential.db; + ret.r() += static_cast<int>(differential.dr); + ret.g() += static_cast<int>(differential.dg); + ret.b() += static_cast<int>(differential.db); } ret.r() = Color::Convert5To8(ret.r()); ret.g() = Color::Convert5To8(ret.g()); ret.b() = Color::Convert5To8(ret.b()); } else { if (x < 2) { - ret.r() = Color::Convert4To8(separate.r1); - ret.g() = Color::Convert4To8(separate.g1); - ret.b() = Color::Convert4To8(separate.b1); + ret.r() = Color::Convert4To8(static_cast<u8>(separate.r1)); + ret.g() = Color::Convert4To8(static_cast<u8>(separate.g1)); + ret.b() = Color::Convert4To8(static_cast<u8>(separate.b1)); } else { - ret.r() = Color::Convert4To8(separate.r2); - ret.g() = Color::Convert4To8(separate.g2); - ret.b() = Color::Convert4To8(separate.b2); + ret.r() = Color::Convert4To8(static_cast<u8>(separate.r2)); + ret.g() = Color::Convert4To8(static_cast<u8>(separate.g2)); + ret.b() = Color::Convert4To8(static_cast<u8>(separate.b2)); } } // Add modifier - unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value(); + unsigned table_index = static_cast<int>((x < 2) ? table_index_1.Value() : table_index_2.Value()); static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, diff --git a/src/video_core/pica.h b/src/video_core/pica.h index aec6f0660..38599a7a3 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -913,7 +913,7 @@ struct Regs { #define ADD_FIELD(name) \ do { \ - map.insert({PICA_REG_INDEX(name), #name}); \ + map.insert({static_cast<u32>(PICA_REG_INDEX(name)), #name}); \ /* 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))}); \ |