From 716120da3d2f631edbb60638c2dd4b5400139c37 Mon Sep 17 00:00:00 2001 From: zawata Date: Sat, 27 Jun 2015 19:32:56 -0700 Subject: Video_Core : Fix Conversion Warnings --- src/video_core/debug_utils/debug_utils.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/video_core/debug_utils/debug_utils.cpp') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index d24c0f11..b492b24a 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -85,7 +85,6 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) { vertices.push_back(v1); vertices.push_back(v2); - int num_vertices = vertices.size(); faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); } @@ -241,8 +240,6 @@ 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)); // TODO: Create a label table for "main" @@ -497,31 +494,19 @@ const Math::Vec4 LookupTexture(const u8* source, int x, int y, const Texture // Lookup base value Math::Vec3 ret; if (differential_mode) { - ret.r() = differential.r; - ret.g() = differential.g; - ret.b() = differential.b; + ret.r() = static_cast(differential.r); if (x >= 2) { - ret.r() += differential.dr; - ret.g() += differential.dg; - ret.b() += 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); } else { - ret.r() = Color::Convert4To8(separate.r2); - ret.g() = Color::Convert4To8(separate.g2); - ret.b() = Color::Convert4To8(separate.b2); } } // Add modifier - unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value(); static const std::array, 8> etc1_modifier_table = {{ { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, -- cgit v1.2.3 From 017437e8d77048d40a1e764cc4c2b2c211233e47 Mon Sep 17 00:00:00 2001 From: zawata Date: Sat, 27 Jun 2015 19:35:13 -0700 Subject: Video_Core : Change Tabs to Spaces This really should be universalized, I keep getting errors creating commits because lines I've edited use tabs instead of spaces(and yes I did read the contributing guide and i know they are supposed to be spaces) --- src/video_core/debug_utils/debug_utils.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/video_core/debug_utils/debug_utils.cpp') diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index b492b24a..8f732242 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -85,6 +85,7 @@ void GeometryDumper::AddTriangle(Vertex& v0, Vertex& v1, Vertex& v2) { vertices.push_back(v1); vertices.push_back(v2); + int num_vertices = static_cast(vertices.size()); faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); } @@ -240,6 +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 = static_cast(output_info_table.size()); + QueueForWriting((u8*)output_info_table.data(), static_cast(output_info_table.size() * sizeof(OutputRegisterInfo))); // TODO: Create a label table for "main" @@ -495,18 +498,30 @@ const Math::Vec4 LookupTexture(const u8* source, int x, int y, const Texture Math::Vec3 ret; if (differential_mode) { ret.r() = static_cast(differential.r); + ret.g() = static_cast(differential.g); + ret.b() = static_cast(differential.b); if (x >= 2) { + ret.r() += static_cast(differential.dr); + ret.g() += static_cast(differential.dg); + ret.b() += static_cast(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(static_cast(separate.r1)); + ret.g() = Color::Convert4To8(static_cast(separate.g1)); + ret.b() = Color::Convert4To8(static_cast(separate.b1)); } else { + ret.r() = Color::Convert4To8(static_cast(separate.r2)); + ret.g() = Color::Convert4To8(static_cast(separate.g2)); + ret.b() = Color::Convert4To8(static_cast(separate.b2)); } } // Add modifier + unsigned table_index = static_cast((x < 2) ? table_index_1.Value() : table_index_2.Value()); static const std::array, 8> etc1_modifier_table = {{ { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, -- cgit v1.2.3 From 04756bdaf646abc6b75e62bf37f5a674bc6a64c4 Mon Sep 17 00:00:00 2001 From: zawata Date: Mon, 29 Jun 2015 11:32:53 -0700 Subject: Video_Core : Type fixes --- src/video_core/command_processor.cpp | 2 +- src/video_core/debug_utils/debug_utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/debug_utils/debug_utils.cpp') diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 51ab7015..bfb00019 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 = static_cast(id - PICA_REG_INDEX(command_buffer.trigger[0])); + unsigned index = static_cast(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 8f732242..fc9faffc 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 = static_cast(vertices.size()); + size_t num_vertices = vertices.size(); faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); } -- cgit v1.2.3