diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/command_processor.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 17 | ||||
| -rw-r--r-- | src/video_core/vertex_shader.cpp | 2 |
3 files changed, 3 insertions, 18 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index f2e3aee85..51ab70159 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) { | |||
| 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): | 103 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[0], 0x23c): |
| 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): | 104 | case PICA_REG_INDEX_WORKAROUND(command_buffer.trigger[1], 0x23d): |
| 105 | { | 105 | { |
| 106 | unsigned index = id - PICA_REG_INDEX(command_buffer.trigger[0]); | 106 | unsigned index = static_cast<int>(id - PICA_REG_INDEX(command_buffer.trigger[0])); |
| 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); | 107 | u32* head_ptr = (u32*)Memory::GetPhysicalPointer(regs.command_buffer.GetPhysicalAddress(index)); |
| 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; | 108 | g_state.cmd_list.head_ptr = g_state.cmd_list.current_ptr = head_ptr; |
| 109 | g_state.cmd_list.length = regs.command_buffer.GetSize(index) / sizeof(u32); | 109 | 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..b492b24ad 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) { | |||
| 85 | vertices.push_back(v1); | 85 | vertices.push_back(v1); |
| 86 | vertices.push_back(v2); | 86 | vertices.push_back(v2); |
| 87 | 87 | ||
| 88 | int num_vertices = vertices.size(); | ||
| 89 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); | 88 | faces.push_back({ num_vertices-3, num_vertices-2, num_vertices-1 }); |
| 90 | } | 89 | } |
| 91 | 90 | ||
| @@ -241,8 +240,6 @@ void DumpShader(const u32* binary_data, u32 binary_size, const u32* swizzle_data | |||
| 241 | 240 | ||
| 242 | dvle.main_offset_words = main_offset; | 241 | dvle.main_offset_words = main_offset; |
| 243 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; | 242 | dvle.output_register_table_offset = write_offset - dvlb.dvle_offset; |
| 244 | dvle.output_register_table_size = output_info_table.size(); | ||
| 245 | QueueForWriting((u8*)output_info_table.data(), output_info_table.size() * sizeof(OutputRegisterInfo)); | ||
| 246 | 243 | ||
| 247 | // TODO: Create a label table for "main" | 244 | // TODO: Create a label table for "main" |
| 248 | 245 | ||
| @@ -497,31 +494,19 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture | |||
| 497 | // Lookup base value | 494 | // Lookup base value |
| 498 | Math::Vec3<int> ret; | 495 | Math::Vec3<int> ret; |
| 499 | if (differential_mode) { | 496 | if (differential_mode) { |
| 500 | ret.r() = differential.r; | 497 | ret.r() = static_cast<int>(differential.r); |
| 501 | ret.g() = differential.g; | ||
| 502 | ret.b() = differential.b; | ||
| 503 | if (x >= 2) { | 498 | if (x >= 2) { |
| 504 | ret.r() += differential.dr; | ||
| 505 | ret.g() += differential.dg; | ||
| 506 | ret.b() += differential.db; | ||
| 507 | } | 499 | } |
| 508 | ret.r() = Color::Convert5To8(ret.r()); | 500 | ret.r() = Color::Convert5To8(ret.r()); |
| 509 | ret.g() = Color::Convert5To8(ret.g()); | 501 | ret.g() = Color::Convert5To8(ret.g()); |
| 510 | ret.b() = Color::Convert5To8(ret.b()); | 502 | ret.b() = Color::Convert5To8(ret.b()); |
| 511 | } else { | 503 | } else { |
| 512 | if (x < 2) { | 504 | if (x < 2) { |
| 513 | ret.r() = Color::Convert4To8(separate.r1); | ||
| 514 | ret.g() = Color::Convert4To8(separate.g1); | ||
| 515 | ret.b() = Color::Convert4To8(separate.b1); | ||
| 516 | } else { | 505 | } else { |
| 517 | ret.r() = Color::Convert4To8(separate.r2); | ||
| 518 | ret.g() = Color::Convert4To8(separate.g2); | ||
| 519 | ret.b() = Color::Convert4To8(separate.b2); | ||
| 520 | } | 506 | } |
| 521 | } | 507 | } |
| 522 | 508 | ||
| 523 | // Add modifier | 509 | // Add modifier |
| 524 | unsigned table_index = (x < 2) ? table_index_1.Value() : table_index_2.Value(); | ||
| 525 | 510 | ||
| 526 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ | 511 | static const std::array<std::array<u8, 2>, 8> etc1_modifier_table = {{ |
| 527 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, | 512 | { 2, 8 }, { 5, 17 }, { 9, 29 }, { 13, 42 }, |
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 87006a832..f074a3128 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp | |||
| @@ -96,7 +96,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 96 | state.program_counter = &program_code[offset] - 1; // -1 to make sure when incrementing the PC we end up at the correct offset | 96 | state.program_counter = &program_code[offset] - 1; // -1 to make sure when incrementing the PC we end up at the correct offset |
| 97 | state.call_stack.push({ offset + num_instructions, return_offset, repeat_count, loop_increment, offset }); | 97 | state.call_stack.push({ offset + num_instructions, return_offset, repeat_count, loop_increment, offset }); |
| 98 | }; | 98 | }; |
| 99 | u32 binary_offset = state.program_counter - program_code.data(); | 99 | u32 binary_offset = static_cast<u32>(state.program_counter - program_code.data()); |
| 100 | 100 | ||
| 101 | state.debug.max_offset = std::max<u32>(state.debug.max_offset, 1 + binary_offset); | 101 | state.debug.max_offset = std::max<u32>(state.debug.max_offset, 1 + binary_offset); |
| 102 | 102 | ||