diff options
| -rw-r--r-- | src/audio_core/hle/pipe.cpp | 9 | ||||
| -rw-r--r-- | src/audio_core/hle/pipe.h | 12 | ||||
| -rw-r--r-- | src/citra/config.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/util/util.cpp | 2 | ||||
| -rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/dsp_dsp.cpp | 4 | ||||
| -rw-r--r-- | src/core/hw/gpu.cpp | 4 | ||||
| -rw-r--r-- | src/core/loader/3dsx.cpp | 6 | ||||
| -rw-r--r-- | src/core/tracer/recorder.cpp | 24 | ||||
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/pica_state.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 2 |
14 files changed, 55 insertions, 45 deletions
diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp index 03280780f..44dff1345 100644 --- a/src/audio_core/hle/pipe.cpp +++ b/src/audio_core/hle/pipe.cpp | |||
| @@ -36,12 +36,17 @@ std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) { | |||
| 36 | return {}; | 36 | return {}; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | if (length > UINT16_MAX) { // Can only read at most UINT16_MAX from the pipe | ||
| 40 | LOG_ERROR(Audio_DSP, "length of %u greater than max of %u", length, UINT16_MAX); | ||
| 41 | return {}; | ||
| 42 | } | ||
| 43 | |||
| 39 | std::vector<u8>& data = pipe_data[pipe_index]; | 44 | std::vector<u8>& data = pipe_data[pipe_index]; |
| 40 | 45 | ||
| 41 | if (length > data.size()) { | 46 | if (length > data.size()) { |
| 42 | LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain", | 47 | LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain", |
| 43 | pipe_index, length, data.size()); | 48 | pipe_index, length, data.size()); |
| 44 | length = data.size(); | 49 | length = static_cast<u32>(data.size()); |
| 45 | } | 50 | } |
| 46 | 51 | ||
| 47 | if (length == 0) | 52 | if (length == 0) |
| @@ -94,7 +99,7 @@ static void AudioPipeWriteStructAddresses() { | |||
| 94 | }; | 99 | }; |
| 95 | 100 | ||
| 96 | // Begin with a u16 denoting the number of structs. | 101 | // Begin with a u16 denoting the number of structs. |
| 97 | WriteU16(DspPipe::Audio, struct_addresses.size()); | 102 | WriteU16(DspPipe::Audio, static_cast<u16>(struct_addresses.size())); |
| 98 | // Then write the struct addresses. | 103 | // Then write the struct addresses. |
| 99 | for (u16 addr : struct_addresses) { | 104 | for (u16 addr : struct_addresses) { |
| 100 | WriteU16(DspPipe::Audio, addr); | 105 | WriteU16(DspPipe::Audio, addr); |
diff --git a/src/audio_core/hle/pipe.h b/src/audio_core/hle/pipe.h index 64d97f8ba..b714c0496 100644 --- a/src/audio_core/hle/pipe.h +++ b/src/audio_core/hle/pipe.h | |||
| @@ -24,10 +24,14 @@ enum class DspPipe { | |||
| 24 | constexpr size_t NUM_DSP_PIPE = 8; | 24 | constexpr size_t NUM_DSP_PIPE = 8; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * Read a DSP pipe. | 27 | * Reads `length` bytes from the DSP pipe identified with `pipe_number`. |
| 28 | * @param pipe_number The Pipe ID | 28 | * @note Can read up to the maximum value of a u16 in bytes (65,535). |
| 29 | * @param length How much data to request. | 29 | * @note IF an error is encoutered with either an invalid `pipe_number` or `length` value, an empty vector will be returned. |
| 30 | * @return The data read from the pipe. The size of this vector can be less than the length requested. | 30 | * @note IF `length` is set to 0, an empty vector will be returned. |
| 31 | * @note IF `length` is greater than the amount of data available, this function will only read the available amount. | ||
| 32 | * @param pipe_number a `DspPipe` | ||
| 33 | * @param length the number of bytes to read. The max is 65,535 (max of u16). | ||
| 34 | * @returns a vector of bytes from the specified pipe. On error, will be empty. | ||
| 31 | */ | 35 | */ |
| 32 | std::vector<u8> PipeRead(DspPipe pipe_number, u32 length); | 36 | std::vector<u8> PipeRead(DspPipe pipe_number, u32 length); |
| 33 | 37 | ||
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 0d17c80bf..c5cb4fb38 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -85,7 +85,7 @@ void Config::ReadValues() { | |||
| 85 | 85 | ||
| 86 | // Debugging | 86 | // Debugging |
| 87 | Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); | 87 | Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false); |
| 88 | Settings::values.gdbstub_port = sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689); | 88 | Settings::values.gdbstub_port = static_cast<u16>(sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689)); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | void Config::Reload() { | 91 | void Config::Reload() { |
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index 6e8d7ef42..854f6ff16 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp | |||
| @@ -515,7 +515,7 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d | |||
| 515 | } | 515 | } |
| 516 | 516 | ||
| 517 | // Initialize debug info text for current cycle count | 517 | // Initialize debug info text for current cycle count |
| 518 | cycle_index->setMaximum(debug_data.records.size() - 1); | 518 | cycle_index->setMaximum(static_cast<int>(debug_data.records.size() - 1)); |
| 519 | OnCycleIndexChanged(cycle_index->value()); | 519 | OnCycleIndexChanged(cycle_index->value()); |
| 520 | 520 | ||
| 521 | model->endResetModel(); | 521 | model->endResetModel(); |
diff --git a/src/citra_qt/util/util.cpp b/src/citra_qt/util/util.cpp index 8734a8efd..2f9beb5cc 100644 --- a/src/citra_qt/util/util.cpp +++ b/src/citra_qt/util/util.cpp | |||
| @@ -19,7 +19,7 @@ QString ReadableByteSize(qulonglong size) { | |||
| 19 | static const std::array<const char*, 6> units = { "B", "KiB", "MiB", "GiB", "TiB", "PiB" }; | 19 | static const std::array<const char*, 6> units = { "B", "KiB", "MiB", "GiB", "TiB", "PiB" }; |
| 20 | if (size == 0) | 20 | if (size == 0) |
| 21 | return "0"; | 21 | return "0"; |
| 22 | int digit_groups = std::min<int>((int)(std::log10(size) / std::log10(1024)), units.size()); | 22 | int digit_groups = std::min<int>(static_cast<int>(std::log10(size) / std::log10(1024)), static_cast<int>(units.size())); |
| 23 | return QString("%L1 %2").arg(size / std::pow(1024, digit_groups), 0, 'f', 1) | 23 | return QString("%L1 %2").arg(size / std::pow(1024, digit_groups), 0, 'f', 1) |
| 24 | .arg(units[digit_groups]); | 24 | .arg(units[digit_groups]); |
| 25 | } | 25 | } |
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index ae0c116ef..1360ee845 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -374,7 +374,7 @@ static void SendReply(const char* reply) { | |||
| 374 | 374 | ||
| 375 | memset(command_buffer, 0, sizeof(command_buffer)); | 375 | memset(command_buffer, 0, sizeof(command_buffer)); |
| 376 | 376 | ||
| 377 | command_length = strlen(reply); | 377 | command_length = static_cast<u32>(strlen(reply)); |
| 378 | if (command_length + 4 > sizeof(command_buffer)) { | 378 | if (command_length + 4 > sizeof(command_buffer)) { |
| 379 | LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); | 379 | LOG_ERROR(Debug_GDBStub, "command_buffer overflow in SendReply"); |
| 380 | return; | 380 | return; |
| @@ -515,7 +515,7 @@ static bool IsDataAvailable() { | |||
| 515 | return false; | 515 | return false; |
| 516 | } | 516 | } |
| 517 | 517 | ||
| 518 | return FD_ISSET(gdbserver_socket, &fd_socket); | 518 | return FD_ISSET(gdbserver_socket, &fd_socket) != 0; |
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | /// Send requested register to gdb client. | 521 | /// Send requested register to gdb client. |
| @@ -633,10 +633,10 @@ static void ReadMemory() { | |||
| 633 | 633 | ||
| 634 | auto start_offset = command_buffer+1; | 634 | auto start_offset = command_buffer+1; |
| 635 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 635 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 636 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 636 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 637 | 637 | ||
| 638 | start_offset = addr_pos+1; | 638 | start_offset = addr_pos+1; |
| 639 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 639 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 640 | 640 | ||
| 641 | LOG_DEBUG(Debug_GDBStub, "gdb: addr: %08x len: %08x\n", addr, len); | 641 | LOG_DEBUG(Debug_GDBStub, "gdb: addr: %08x len: %08x\n", addr, len); |
| 642 | 642 | ||
| @@ -658,11 +658,11 @@ static void ReadMemory() { | |||
| 658 | static void WriteMemory() { | 658 | static void WriteMemory() { |
| 659 | auto start_offset = command_buffer+1; | 659 | auto start_offset = command_buffer+1; |
| 660 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 660 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 661 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 661 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 662 | 662 | ||
| 663 | start_offset = addr_pos+1; | 663 | start_offset = addr_pos+1; |
| 664 | auto len_pos = std::find(start_offset, command_buffer+command_length, ':'); | 664 | auto len_pos = std::find(start_offset, command_buffer+command_length, ':'); |
| 665 | u32 len = HexToInt(start_offset, len_pos - start_offset); | 665 | u32 len = HexToInt(start_offset, static_cast<u32>(len_pos - start_offset)); |
| 666 | 666 | ||
| 667 | u8* dst = Memory::GetPointer(addr); | 667 | u8* dst = Memory::GetPointer(addr); |
| 668 | if (!dst) { | 668 | if (!dst) { |
| @@ -752,10 +752,10 @@ static void AddBreakpoint() { | |||
| 752 | 752 | ||
| 753 | auto start_offset = command_buffer+3; | 753 | auto start_offset = command_buffer+3; |
| 754 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 754 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 755 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 755 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 756 | 756 | ||
| 757 | start_offset = addr_pos+1; | 757 | start_offset = addr_pos+1; |
| 758 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 758 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 759 | 759 | ||
| 760 | if (type == BreakpointType::Access) { | 760 | if (type == BreakpointType::Access) { |
| 761 | // Access is made up of Read and Write types, so add both breakpoints | 761 | // Access is made up of Read and Write types, so add both breakpoints |
| @@ -800,10 +800,10 @@ static void RemoveBreakpoint() { | |||
| 800 | 800 | ||
| 801 | auto start_offset = command_buffer+3; | 801 | auto start_offset = command_buffer+3; |
| 802 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); | 802 | auto addr_pos = std::find(start_offset, command_buffer+command_length, ','); |
| 803 | PAddr addr = HexToInt(start_offset, addr_pos - start_offset); | 803 | PAddr addr = HexToInt(start_offset, static_cast<u32>(addr_pos - start_offset)); |
| 804 | 804 | ||
| 805 | start_offset = addr_pos+1; | 805 | start_offset = addr_pos+1; |
| 806 | u32 len = HexToInt(start_offset, (command_buffer + command_length) - start_offset); | 806 | u32 len = HexToInt(start_offset, static_cast<u32>((command_buffer + command_length) - start_offset)); |
| 807 | 807 | ||
| 808 | if (type == BreakpointType::Access) { | 808 | if (type == BreakpointType::Access) { |
| 809 | // Access is made up of Read and Write types, so add both breakpoints | 809 | // Access is made up of Read and Write types, so add both breakpoints |
diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 995bee3f9..274fc751a 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp | |||
| @@ -288,7 +288,7 @@ static void WriteProcessPipe(Service::Interface* self) { | |||
| 288 | ASSERT_MSG(Memory::GetPointer(buffer) != nullptr, "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer); | 288 | ASSERT_MSG(Memory::GetPointer(buffer) != nullptr, "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe_index, size, buffer); |
| 289 | 289 | ||
| 290 | std::vector<u8> message(size); | 290 | std::vector<u8> message(size); |
| 291 | for (size_t i = 0; i < size; i++) { | 291 | for (u32 i = 0; i < size; i++) { |
| 292 | message[i] = Memory::Read8(buffer + i); | 292 | message[i] = Memory::Read8(buffer + i); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| @@ -403,7 +403,7 @@ static void GetPipeReadableSize(Service::Interface* self) { | |||
| 403 | 403 | ||
| 404 | cmd_buff[0] = IPC::MakeHeader(0xF, 2, 0); | 404 | cmd_buff[0] = IPC::MakeHeader(0xF, 2, 0); |
| 405 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 405 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 406 | cmd_buff[2] = DSP::HLE::GetPipeReadableSize(pipe); | 406 | cmd_buff[2] = static_cast<u32>(DSP::HLE::GetPipeReadableSize(pipe)); |
| 407 | 407 | ||
| 408 | LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]); | 408 | LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]); |
| 409 | } | 409 | } |
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 2fe856293..a4dfb7e43 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -188,10 +188,10 @@ inline void Write(u32 addr, const T data) { | |||
| 188 | u32 output_gap = config.texture_copy.output_gap * 16; | 188 | u32 output_gap = config.texture_copy.output_gap * 16; |
| 189 | 189 | ||
| 190 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); | 190 | size_t contiguous_input_size = config.texture_copy.size / input_width * (input_width + input_gap); |
| 191 | Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), contiguous_input_size); | 191 | Memory::RasterizerFlushRegion(config.GetPhysicalInputAddress(), static_cast<u32>(contiguous_input_size)); |
| 192 | 192 | ||
| 193 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); | 193 | size_t contiguous_output_size = config.texture_copy.size / output_width * (output_width + output_gap); |
| 194 | Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), contiguous_output_size); | 194 | Memory::RasterizerFlushAndInvalidateRegion(config.GetPhysicalOutputAddress(), static_cast<u32>(contiguous_output_size)); |
| 195 | 195 | ||
| 196 | u32 remaining_size = config.texture_copy.size; | 196 | u32 remaining_size = config.texture_copy.size; |
| 197 | u32 remaining_input = input_width; | 197 | u32 remaining_input = input_width; |
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 48a11ef81..98e7ab48f 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp | |||
| @@ -178,11 +178,11 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, Shared | |||
| 178 | for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { | 178 | for (unsigned current_inprogress = 0; current_inprogress < remaining && pos < end_pos; current_inprogress++) { |
| 179 | const auto& table = reloc_table[current_inprogress]; | 179 | const auto& table = reloc_table[current_inprogress]; |
| 180 | LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)", current_segment_reloc_table, | 180 | LOG_TRACE(Loader, "(t=%d,skip=%u,patch=%u)", current_segment_reloc_table, |
| 181 | (u32)table.skip, (u32)table.patch); | 181 | static_cast<u32>(table.skip), static_cast<u32>(table.patch)); |
| 182 | pos += table.skip; | 182 | pos += table.skip; |
| 183 | s32 num_patches = table.patch; | 183 | s32 num_patches = table.patch; |
| 184 | while (0 < num_patches && pos < end_pos) { | 184 | while (0 < num_patches && pos < end_pos) { |
| 185 | u32 in_addr = (u8*)pos - program_image.data(); | 185 | u32 in_addr = static_cast<u32>(reinterpret_cast<u8*>(pos) - program_image.data()); |
| 186 | u32 addr = TranslateAddr(*pos, &loadinfo, offsets); | 186 | u32 addr = TranslateAddr(*pos, &loadinfo, offsets); |
| 187 | LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)", | 187 | LOG_TRACE(Loader, "Patching %08X <-- rel(%08X,%d) (%08X)", |
| 188 | base_addr + in_addr, addr, current_segment_reloc_table, *pos); | 188 | base_addr + in_addr, addr, current_segment_reloc_table, *pos); |
| @@ -284,7 +284,7 @@ ResultStatus AppLoader_THREEDSX::ReadRomFS(std::shared_ptr<FileUtil::IOFile>& ro | |||
| 284 | // Check if the 3DSX has a RomFS... | 284 | // Check if the 3DSX has a RomFS... |
| 285 | if (hdr.fs_offset != 0) { | 285 | if (hdr.fs_offset != 0) { |
| 286 | u32 romfs_offset = hdr.fs_offset; | 286 | u32 romfs_offset = hdr.fs_offset; |
| 287 | u32 romfs_size = file.GetSize() - hdr.fs_offset; | 287 | u32 romfs_size = static_cast<u32>(file.GetSize()) - hdr.fs_offset; |
| 288 | 288 | ||
| 289 | LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset); | 289 | LOG_DEBUG(Loader, "RomFS offset: 0x%08X", romfs_offset); |
| 290 | LOG_DEBUG(Loader, "RomFS size: 0x%08X", romfs_size); | 290 | LOG_DEBUG(Loader, "RomFS size: 0x%08X", romfs_size); |
diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index c6dc35c83..7abaacf70 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp | |||
| @@ -26,17 +26,17 @@ void Recorder::Finish(const std::string& filename) { | |||
| 26 | // Calculate file offsets | 26 | // Calculate file offsets |
| 27 | auto& initial = header.initial_state_offsets; | 27 | auto& initial = header.initial_state_offsets; |
| 28 | 28 | ||
| 29 | initial.gpu_registers_size = initial_state.gpu_registers.size(); | 29 | initial.gpu_registers_size = static_cast<u32>(initial_state.gpu_registers.size()); |
| 30 | initial.lcd_registers_size = initial_state.lcd_registers.size(); | 30 | initial.lcd_registers_size = static_cast<u32>(initial_state.lcd_registers.size()); |
| 31 | initial.pica_registers_size = initial_state.pica_registers.size(); | 31 | initial.pica_registers_size = static_cast<u32>(initial_state.pica_registers.size()); |
| 32 | initial.default_attributes_size = initial_state.default_attributes.size(); | 32 | initial.default_attributes_size = static_cast<u32>(initial_state.default_attributes.size()); |
| 33 | initial.vs_program_binary_size = initial_state.vs_program_binary.size(); | 33 | initial.vs_program_binary_size = static_cast<u32>(initial_state.vs_program_binary.size()); |
| 34 | initial.vs_swizzle_data_size = initial_state.vs_swizzle_data.size(); | 34 | initial.vs_swizzle_data_size = static_cast<u32>(initial_state.vs_swizzle_data.size()); |
| 35 | initial.vs_float_uniforms_size = initial_state.vs_float_uniforms.size(); | 35 | initial.vs_float_uniforms_size = static_cast<u32>(initial_state.vs_float_uniforms.size()); |
| 36 | initial.gs_program_binary_size = initial_state.gs_program_binary.size(); | 36 | initial.gs_program_binary_size = static_cast<u32>(initial_state.gs_program_binary.size()); |
| 37 | initial.gs_swizzle_data_size = initial_state.gs_swizzle_data.size(); | 37 | initial.gs_swizzle_data_size = static_cast<u32>(initial_state.gs_swizzle_data.size()); |
| 38 | initial.gs_float_uniforms_size = initial_state.gs_float_uniforms.size(); | 38 | initial.gs_float_uniforms_size = static_cast<u32>(initial_state.gs_float_uniforms.size()); |
| 39 | header.stream_size = stream.size(); | 39 | header.stream_size = static_cast<u32>(stream.size()); |
| 40 | 40 | ||
| 41 | initial.gpu_registers = sizeof(header); | 41 | initial.gpu_registers = sizeof(header); |
| 42 | initial.lcd_registers = initial.gpu_registers + initial.gpu_registers_size * sizeof(u32); | 42 | initial.lcd_registers = initial.gpu_registers + initial.gpu_registers_size * sizeof(u32); |
| @@ -68,7 +68,7 @@ void Recorder::Finish(const std::string& filename) { | |||
| 68 | DEBUG_ASSERT(stream_element.extra_data.size() == 0); | 68 | DEBUG_ASSERT(stream_element.extra_data.size() == 0); |
| 69 | break; | 69 | break; |
| 70 | } | 70 | } |
| 71 | header.stream_offset += stream_element.extra_data.size(); | 71 | header.stream_offset += static_cast<u32>(stream_element.extra_data.size()); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | try { | 74 | try { |
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index fb20f81dd..2f645b441 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -208,11 +208,12 @@ void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, c | |||
| 208 | 208 | ||
| 209 | // TODO: Reduce the amount of binary code written to relevant portions | 209 | // TODO: Reduce the amount of binary code written to relevant portions |
| 210 | dvlp.binary_offset = write_offset - dvlp_offset; | 210 | dvlp.binary_offset = write_offset - dvlp_offset; |
| 211 | dvlp.binary_size_words = setup.program_code.size(); | 211 | dvlp.binary_size_words = static_cast<uint32_t>(setup.program_code.size()); |
| 212 | QueueForWriting(reinterpret_cast<const u8*>(setup.program_code.data()), setup.program_code.size() * sizeof(u32)); | 212 | QueueForWriting(reinterpret_cast<const u8*>(setup.program_code.data()), |
| 213 | static_cast<u32>(setup.program_code.size()) * sizeof(u32)); | ||
| 213 | 214 | ||
| 214 | dvlp.swizzle_info_offset = write_offset - dvlp_offset; | 215 | dvlp.swizzle_info_offset = write_offset - dvlp_offset; |
| 215 | dvlp.swizzle_info_num_entries = setup.swizzle_data.size(); | 216 | dvlp.swizzle_info_num_entries = static_cast<uint32_t>(setup.swizzle_data.size()); |
| 216 | u32 dummy = 0; | 217 | u32 dummy = 0; |
| 217 | for (unsigned int i = 0; i < setup.swizzle_data.size(); ++i) { | 218 | for (unsigned int i = 0; i < setup.swizzle_data.size(); ++i) { |
| 218 | QueueForWriting(reinterpret_cast<const u8*>(&setup.swizzle_data[i]), sizeof(setup.swizzle_data[i])); | 219 | QueueForWriting(reinterpret_cast<const u8*>(&setup.swizzle_data[i]), sizeof(setup.swizzle_data[i])); |
| @@ -264,7 +265,7 @@ void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, c | |||
| 264 | constant_table.emplace_back(constant); | 265 | constant_table.emplace_back(constant); |
| 265 | } | 266 | } |
| 266 | dvle.constant_table_offset = write_offset - dvlb.dvle_offset; | 267 | dvle.constant_table_offset = write_offset - dvlb.dvle_offset; |
| 267 | dvle.constant_table_size = constant_table.size(); | 268 | dvle.constant_table_size = static_cast<uint32_t>(constant_table.size()); |
| 268 | for (const auto& constant : constant_table) { | 269 | for (const auto& constant : constant_table) { |
| 269 | QueueForWriting(reinterpret_cast<const u8*>(&constant), sizeof(constant)); | 270 | QueueForWriting(reinterpret_cast<const u8*>(&constant), sizeof(constant)); |
| 270 | } | 271 | } |
diff --git a/src/video_core/pica_state.h b/src/video_core/pica_state.h index bbecad850..1059c6ae4 100644 --- a/src/video_core/pica_state.h +++ b/src/video_core/pica_state.h | |||
| @@ -56,7 +56,7 @@ struct State { | |||
| 56 | // Used to buffer partial vertices for immediate-mode rendering. | 56 | // Used to buffer partial vertices for immediate-mode rendering. |
| 57 | Shader::InputVertex input_vertex; | 57 | Shader::InputVertex input_vertex; |
| 58 | // Index of the next attribute to be loaded into `input_vertex`. | 58 | // Index of the next attribute to be loaded into `input_vertex`. |
| 59 | int current_attribute = 0; | 59 | u32 current_attribute = 0; |
| 60 | } immediate; | 60 | } immediate; |
| 61 | 61 | ||
| 62 | // This is constructed with a dummy triangle topology | 62 | // This is constructed with a dummy triangle topology |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 519d81aeb..0b471dfd2 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -93,7 +93,7 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) { | |||
| 93 | state.Apply(); | 93 | state.Apply(); |
| 94 | 94 | ||
| 95 | for (size_t i = 0; i < lighting_luts.size(); ++i) { | 95 | for (size_t i = 0; i < lighting_luts.size(); ++i) { |
| 96 | glActiveTexture(GL_TEXTURE3 + i); | 96 | glActiveTexture(static_cast<GLenum>(GL_TEXTURE3 + i)); |
| 97 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, 256, 0, GL_RGBA, GL_FLOAT, nullptr); | 97 | glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, 256, 0, GL_RGBA, GL_FLOAT, nullptr); |
| 98 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 98 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 99 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 99 | glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 7fcd36409..8f424a435 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -192,7 +192,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram | |||
| 192 | // only allows rows to have a memory alignement of 4. | 192 | // only allows rows to have a memory alignement of 4. |
| 193 | ASSERT(pixel_stride % 4 == 0); | 193 | ASSERT(pixel_stride % 4 == 0); |
| 194 | 194 | ||
| 195 | if (!Rasterizer()->AccelerateDisplay(framebuffer, framebuffer_addr, pixel_stride, screen_info)) { | 195 | if (!Rasterizer()->AccelerateDisplay(framebuffer, framebuffer_addr, static_cast<u32>(pixel_stride), screen_info)) { |
| 196 | // Reset the screen info's display texture to its own permanent texture | 196 | // Reset the screen info's display texture to its own permanent texture |
| 197 | screen_info.display_texture = screen_info.texture.resource.handle; | 197 | screen_info.display_texture = screen_info.texture.resource.handle; |
| 198 | screen_info.display_texcoords = MathUtil::Rectangle<float>(0.f, 0.f, 1.f, 1.f); | 198 | screen_info.display_texcoords = MathUtil::Rectangle<float>(0.f, 0.f, 1.f, 1.f); |