diff options
| author | 2018-08-31 12:21:34 -0400 | |
|---|---|---|
| committer | 2018-08-31 16:30:14 -0400 | |
| commit | 4a587b81b285bcd41246329e89591be7cfe37c8a (patch) | |
| tree | 8eda46d4aac083d23a52223e1a3fc46bc6690a6c /src | |
| parent | Merge pull request #1205 from bunnei/improve-rasterizer-cache-2 (diff) | |
| download | yuzu-4a587b81b285bcd41246329e89591be7cfe37c8a.tar.gz yuzu-4a587b81b285bcd41246329e89591be7cfe37c8a.tar.xz yuzu-4a587b81b285bcd41246329e89591be7cfe37c8a.zip | |
core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which
replaces most of the includes in the core header with forward declarations.
This makes it so that if any of the headers the core header was
previously including change, then no one will need to rebuild the bulk
of the core, due to core.h being quite a prevalent inclusion.
This should make turnaround for changes much faster for developers.
Diffstat (limited to 'src')
29 files changed, 185 insertions, 66 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index f96e08212..de44ccebd 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 10 | #include "core/arm/dynarmic/arm_dynarmic.h" | 10 | #include "core/arm/dynarmic/arm_dynarmic.h" |
| 11 | #include "core/core.h" | 11 | #include "core/core.h" |
| 12 | #include "core/core_cpu.h" | ||
| 12 | #include "core/core_timing.h" | 13 | #include "core/core_timing.h" |
| 13 | #include "core/hle/kernel/process.h" | 14 | #include "core/hle/kernel/process.h" |
| 14 | #include "core/hle/kernel/svc.h" | 15 | #include "core/hle/kernel/svc.h" |
diff --git a/src/core/core.cpp b/src/core/core.cpp index 75c259068..2cfae18df 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -2,24 +2,35 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <array> | ||
| 6 | #include <map> | ||
| 5 | #include <memory> | 7 | #include <memory> |
| 8 | #include <thread> | ||
| 6 | #include <utility> | 9 | #include <utility> |
| 10 | |||
| 7 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 8 | #include "common/string_util.h" | 12 | #include "common/string_util.h" |
| 13 | #include "core/arm/exclusive_monitor.h" | ||
| 9 | #include "core/core.h" | 14 | #include "core/core.h" |
| 15 | #include "core/core_cpu.h" | ||
| 10 | #include "core/core_timing.h" | 16 | #include "core/core_timing.h" |
| 11 | #include "core/gdbstub/gdbstub.h" | 17 | #include "core/gdbstub/gdbstub.h" |
| 12 | #include "core/hle/kernel/client_port.h" | 18 | #include "core/hle/kernel/client_port.h" |
| 13 | #include "core/hle/kernel/kernel.h" | 19 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/kernel/process.h" | 20 | #include "core/hle/kernel/process.h" |
| 21 | #include "core/hle/kernel/scheduler.h" | ||
| 15 | #include "core/hle/kernel/thread.h" | 22 | #include "core/hle/kernel/thread.h" |
| 16 | #include "core/hle/service/service.h" | 23 | #include "core/hle/service/service.h" |
| 17 | #include "core/hle/service/sm/controller.h" | 24 | #include "core/hle/service/sm/controller.h" |
| 18 | #include "core/hle/service/sm/sm.h" | 25 | #include "core/hle/service/sm/sm.h" |
| 19 | #include "core/loader/loader.h" | 26 | #include "core/loader/loader.h" |
| 27 | #include "core/perf_stats.h" | ||
| 20 | #include "core/settings.h" | 28 | #include "core/settings.h" |
| 29 | #include "core/telemetry_session.h" | ||
| 21 | #include "file_sys/vfs_concat.h" | 30 | #include "file_sys/vfs_concat.h" |
| 22 | #include "file_sys/vfs_real.h" | 31 | #include "file_sys/vfs_real.h" |
| 32 | #include "video_core/debug_utils/debug_utils.h" | ||
| 33 | #include "video_core/gpu.h" | ||
| 23 | #include "video_core/renderer_base.h" | 34 | #include "video_core/renderer_base.h" |
| 24 | #include "video_core/video_core.h" | 35 | #include "video_core/video_core.h" |
| 25 | 36 | ||
| @@ -258,7 +269,7 @@ struct System::Impl { | |||
| 258 | } | 269 | } |
| 259 | } | 270 | } |
| 260 | 271 | ||
| 261 | PerfStats::Results GetAndResetPerfStats() { | 272 | PerfStatsResults GetAndResetPerfStats() { |
| 262 | return perf_stats.GetAndResetStats(CoreTiming::GetGlobalTimeUs()); | 273 | return perf_stats.GetAndResetStats(CoreTiming::GetGlobalTimeUs()); |
| 263 | } | 274 | } |
| 264 | 275 | ||
| @@ -326,7 +337,7 @@ void System::PrepareReschedule() { | |||
| 326 | CurrentCpuCore().PrepareReschedule(); | 337 | CurrentCpuCore().PrepareReschedule(); |
| 327 | } | 338 | } |
| 328 | 339 | ||
| 329 | PerfStats::Results System::GetAndResetPerfStats() { | 340 | PerfStatsResults System::GetAndResetPerfStats() { |
| 330 | return impl->GetAndResetPerfStats(); | 341 | return impl->GetAndResetPerfStats(); |
| 331 | } | 342 | } |
| 332 | 343 | ||
| @@ -433,11 +444,11 @@ std::shared_ptr<Tegra::DebugContext> System::GetGPUDebugContext() const { | |||
| 433 | return impl->debug_context; | 444 | return impl->debug_context; |
| 434 | } | 445 | } |
| 435 | 446 | ||
| 436 | void System::SetFilesystem(FileSys::VirtualFilesystem vfs) { | 447 | void System::SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs) { |
| 437 | impl->virtual_filesystem = std::move(vfs); | 448 | impl->virtual_filesystem = std::move(vfs); |
| 438 | } | 449 | } |
| 439 | 450 | ||
| 440 | FileSys::VirtualFilesystem System::GetFilesystem() const { | 451 | std::shared_ptr<FileSys::VfsFilesystem> System::GetFilesystem() const { |
| 441 | return impl->virtual_filesystem; | 452 | return impl->virtual_filesystem; |
| 442 | } | 453 | } |
| 443 | 454 | ||
diff --git a/src/core/core.h b/src/core/core.h index 984e8f94c..eee1fecc1 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -4,41 +4,55 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <cstddef> |
| 8 | #include <map> | ||
| 9 | #include <memory> | 8 | #include <memory> |
| 10 | #include <string> | 9 | #include <string> |
| 11 | #include <thread> | 10 | |
| 12 | #include "common/common_types.h" | 11 | #include "common/common_types.h" |
| 13 | #include "core/arm/exclusive_monitor.h" | ||
| 14 | #include "core/core_cpu.h" | ||
| 15 | #include "core/hle/kernel/kernel.h" | ||
| 16 | #include "core/hle/kernel/object.h" | 12 | #include "core/hle/kernel/object.h" |
| 17 | #include "core/hle/kernel/scheduler.h" | ||
| 18 | #include "core/loader/loader.h" | ||
| 19 | #include "core/memory.h" | ||
| 20 | #include "core/perf_stats.h" | ||
| 21 | #include "core/telemetry_session.h" | ||
| 22 | #include "file_sys/vfs_real.h" | ||
| 23 | #include "hle/service/filesystem/filesystem.h" | ||
| 24 | #include "video_core/debug_utils/debug_utils.h" | ||
| 25 | #include "video_core/gpu.h" | ||
| 26 | 13 | ||
| 27 | namespace Core::Frontend { | 14 | namespace Core::Frontend { |
| 28 | class EmuWindow; | 15 | class EmuWindow; |
| 29 | } | 16 | } // namespace Core::Frontend |
| 17 | |||
| 18 | namespace FileSys { | ||
| 19 | class VfsFilesystem; | ||
| 20 | } // namespace FileSys | ||
| 21 | |||
| 22 | namespace Kernel { | ||
| 23 | class KernelCore; | ||
| 24 | class Process; | ||
| 25 | class Scheduler; | ||
| 26 | } // namespace Kernel | ||
| 27 | |||
| 28 | namespace Loader { | ||
| 29 | class AppLoader; | ||
| 30 | enum class ResultStatus : u16; | ||
| 31 | } // namespace Loader | ||
| 30 | 32 | ||
| 31 | namespace Service::SM { | 33 | namespace Service::SM { |
| 32 | class ServiceManager; | 34 | class ServiceManager; |
| 33 | } | 35 | } // namespace Service::SM |
| 36 | |||
| 37 | namespace Tegra { | ||
| 38 | class DebugContext; | ||
| 39 | class GPU; | ||
| 40 | } // namespace Tegra | ||
| 34 | 41 | ||
| 35 | namespace VideoCore { | 42 | namespace VideoCore { |
| 36 | class RendererBase; | 43 | class RendererBase; |
| 37 | } | 44 | } // namespace VideoCore |
| 38 | 45 | ||
| 39 | namespace Core { | 46 | namespace Core { |
| 40 | 47 | ||
| 41 | class ARM_Interface; | 48 | class ARM_Interface; |
| 49 | class Cpu; | ||
| 50 | class ExclusiveMonitor; | ||
| 51 | class FrameLimiter; | ||
| 52 | class PerfStats; | ||
| 53 | class TelemetrySession; | ||
| 54 | |||
| 55 | struct PerfStatsResults; | ||
| 42 | 56 | ||
| 43 | class System { | 57 | class System { |
| 44 | public: | 58 | public: |
| @@ -125,7 +139,7 @@ public: | |||
| 125 | void PrepareReschedule(); | 139 | void PrepareReschedule(); |
| 126 | 140 | ||
| 127 | /// Gets and resets core performance statistics | 141 | /// Gets and resets core performance statistics |
| 128 | PerfStats::Results GetAndResetPerfStats(); | 142 | PerfStatsResults GetAndResetPerfStats(); |
| 129 | 143 | ||
| 130 | /// Gets an ARM interface to the CPU core that is currently running | 144 | /// Gets an ARM interface to the CPU core that is currently running |
| 131 | ARM_Interface& CurrentArmInterface(); | 145 | ARM_Interface& CurrentArmInterface(); |
| @@ -197,9 +211,9 @@ public: | |||
| 197 | 211 | ||
| 198 | std::shared_ptr<Tegra::DebugContext> GetGPUDebugContext() const; | 212 | std::shared_ptr<Tegra::DebugContext> GetGPUDebugContext() const; |
| 199 | 213 | ||
| 200 | void SetFilesystem(FileSys::VirtualFilesystem vfs); | 214 | void SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs); |
| 201 | 215 | ||
| 202 | FileSys::VirtualFilesystem GetFilesystem() const; | 216 | std::shared_ptr<FileSys::VfsFilesystem> GetFilesystem() const; |
| 203 | 217 | ||
| 204 | private: | 218 | private: |
| 205 | System(); | 219 | System(); |
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index 034d3a78f..952bd74b3 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/file_sys/savedata_factory.h" | 9 | #include "core/file_sys/savedata_factory.h" |
| 10 | #include "core/file_sys/vfs.h" | ||
| 10 | #include "core/hle/kernel/process.h" | 11 | #include "core/hle/kernel/process.h" |
| 11 | 12 | ||
| 12 | namespace FileSys { | 13 | namespace FileSys { |
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 368b36017..c6f9549f0 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <string> | 8 | #include <string> |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/swap.h" | 10 | #include "common/swap.h" |
| 11 | #include "core/file_sys/vfs.h" | ||
| 11 | #include "core/hle/result.h" | 12 | #include "core/hle/result.h" |
| 12 | 13 | ||
| 13 | namespace FileSys { | 14 | namespace FileSys { |
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 03a954a9f..6657accd5 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -8,9 +8,11 @@ | |||
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "core/core.h" | 10 | #include "core/core.h" |
| 11 | #include "core/core_cpu.h" | ||
| 11 | #include "core/hle/kernel/errors.h" | 12 | #include "core/hle/kernel/errors.h" |
| 12 | #include "core/hle/kernel/object.h" | 13 | #include "core/hle/kernel/object.h" |
| 13 | #include "core/hle/kernel/process.h" | 14 | #include "core/hle/kernel/process.h" |
| 15 | #include "core/hle/kernel/scheduler.h" | ||
| 14 | #include "core/hle/kernel/thread.h" | 16 | #include "core/hle/kernel/thread.h" |
| 15 | #include "core/hle/result.h" | 17 | #include "core/hle/result.h" |
| 16 | #include "core/memory.h" | 18 | #include "core/memory.h" |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index db7aef766..7264be906 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "core/hle/kernel/event.h" | 18 | #include "core/hle/kernel/event.h" |
| 19 | #include "core/hle/kernel/handle_table.h" | 19 | #include "core/hle/kernel/handle_table.h" |
| 20 | #include "core/hle/kernel/hle_ipc.h" | 20 | #include "core/hle/kernel/hle_ipc.h" |
| 21 | #include "core/hle/kernel/kernel.h" | ||
| 21 | #include "core/hle/kernel/object.h" | 22 | #include "core/hle/kernel/object.h" |
| 22 | #include "core/hle/kernel/process.h" | 23 | #include "core/hle/kernel/process.h" |
| 23 | #include "core/hle/kernel/server_session.h" | 24 | #include "core/hle/kernel/server_session.h" |
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 90c9a5aff..aba0cab96 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "core/hle/kernel/client_session.h" | 13 | #include "core/hle/kernel/client_session.h" |
| 14 | #include "core/hle/kernel/handle_table.h" | 14 | #include "core/hle/kernel/handle_table.h" |
| 15 | #include "core/hle/kernel/hle_ipc.h" | 15 | #include "core/hle/kernel/hle_ipc.h" |
| 16 | #include "core/hle/kernel/kernel.h" | ||
| 16 | #include "core/hle/kernel/process.h" | 17 | #include "core/hle/kernel/process.h" |
| 17 | #include "core/hle/kernel/server_session.h" | 18 | #include "core/hle/kernel/server_session.h" |
| 18 | #include "core/hle/kernel/session.h" | 19 | #include "core/hle/kernel/session.h" |
| @@ -104,11 +105,10 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) { | |||
| 104 | // The ServerSession received a sync request, this means that there's new data available | 105 | // The ServerSession received a sync request, this means that there's new data available |
| 105 | // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or | 106 | // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or |
| 106 | // similar. | 107 | // similar. |
| 107 | |||
| 108 | auto& handle_table = Core::System::GetInstance().Kernel().HandleTable(); | ||
| 109 | Kernel::HLERequestContext context(this); | 108 | Kernel::HLERequestContext context(this); |
| 110 | u32* cmd_buf = (u32*)Memory::GetPointer(thread->GetTLSAddress()); | 109 | u32* cmd_buf = (u32*)Memory::GetPointer(thread->GetTLSAddress()); |
| 111 | context.PopulateFromIncomingCommandBuffer(cmd_buf, *Core::CurrentProcess(), handle_table); | 110 | context.PopulateFromIncomingCommandBuffer(cmd_buf, *Core::CurrentProcess(), |
| 111 | kernel.HandleTable()); | ||
| 112 | 112 | ||
| 113 | ResultCode result = RESULT_SUCCESS; | 113 | ResultCode result = RESULT_SUCCESS; |
| 114 | // If the session has been converted to a domain, handle the domain request | 114 | // If the session has been converted to a domain, handle the domain request |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 099d1053f..5da71cff0 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -12,16 +12,20 @@ | |||
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/microprofile.h" | 13 | #include "common/microprofile.h" |
| 14 | #include "common/string_util.h" | 14 | #include "common/string_util.h" |
| 15 | #include "core/arm/exclusive_monitor.h" | ||
| 15 | #include "core/core.h" | 16 | #include "core/core.h" |
| 17 | #include "core/core_cpu.h" | ||
| 16 | #include "core/core_timing.h" | 18 | #include "core/core_timing.h" |
| 17 | #include "core/hle/kernel/address_arbiter.h" | 19 | #include "core/hle/kernel/address_arbiter.h" |
| 18 | #include "core/hle/kernel/client_port.h" | 20 | #include "core/hle/kernel/client_port.h" |
| 19 | #include "core/hle/kernel/client_session.h" | 21 | #include "core/hle/kernel/client_session.h" |
| 20 | #include "core/hle/kernel/event.h" | 22 | #include "core/hle/kernel/event.h" |
| 21 | #include "core/hle/kernel/handle_table.h" | 23 | #include "core/hle/kernel/handle_table.h" |
| 24 | #include "core/hle/kernel/kernel.h" | ||
| 22 | #include "core/hle/kernel/mutex.h" | 25 | #include "core/hle/kernel/mutex.h" |
| 23 | #include "core/hle/kernel/process.h" | 26 | #include "core/hle/kernel/process.h" |
| 24 | #include "core/hle/kernel/resource_limit.h" | 27 | #include "core/hle/kernel/resource_limit.h" |
| 28 | #include "core/hle/kernel/scheduler.h" | ||
| 25 | #include "core/hle/kernel/shared_memory.h" | 29 | #include "core/hle/kernel/shared_memory.h" |
| 26 | #include "core/hle/kernel/svc.h" | 30 | #include "core/hle/kernel/svc.h" |
| 27 | #include "core/hle/kernel/svc_wrap.h" | 31 | #include "core/hle/kernel/svc_wrap.h" |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 520ea0853..3d10d9af2 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include "common/thread_queue_list.h" | 16 | #include "common/thread_queue_list.h" |
| 17 | #include "core/arm/arm_interface.h" | 17 | #include "core/arm/arm_interface.h" |
| 18 | #include "core/core.h" | 18 | #include "core/core.h" |
| 19 | #include "core/core_cpu.h" | ||
| 19 | #include "core/core_timing.h" | 20 | #include "core/core_timing.h" |
| 20 | #include "core/core_timing_util.h" | 21 | #include "core/core_timing_util.h" |
| 21 | #include "core/hle/kernel/errors.h" | 22 | #include "core/hle/kernel/errors.h" |
| @@ -23,8 +24,8 @@ | |||
| 23 | #include "core/hle/kernel/kernel.h" | 24 | #include "core/hle/kernel/kernel.h" |
| 24 | #include "core/hle/kernel/object.h" | 25 | #include "core/hle/kernel/object.h" |
| 25 | #include "core/hle/kernel/process.h" | 26 | #include "core/hle/kernel/process.h" |
| 27 | #include "core/hle/kernel/scheduler.h" | ||
| 26 | #include "core/hle/kernel/thread.h" | 28 | #include "core/hle/kernel/thread.h" |
| 27 | #include "core/hle/lock.h" | ||
| 28 | #include "core/hle/result.h" | 29 | #include "core/hle/result.h" |
| 29 | #include "core/memory.h" | 30 | #include "core/memory.h" |
| 30 | 31 | ||
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index d88a66825..9ba0e2eab 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "core/file_sys/directory.h" | 9 | #include "core/file_sys/directory.h" |
| 10 | #include "core/file_sys/vfs.h" | ||
| 10 | #include "core/hle/result.h" | 11 | #include "core/hle/result.h" |
| 11 | 12 | ||
| 12 | namespace FileSys { | 13 | namespace FileSys { |
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index a53fa6e00..921b899e2 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "core/file_sys/control_metadata.h" | 11 | #include "core/file_sys/control_metadata.h" |
| 12 | #include "core/file_sys/romfs_factory.h" | 12 | #include "core/file_sys/romfs_factory.h" |
| 13 | #include "core/gdbstub/gdbstub.h" | 13 | #include "core/gdbstub/gdbstub.h" |
| 14 | #include "core/hle/kernel/kernel.h" | ||
| 14 | #include "core/hle/kernel/process.h" | 15 | #include "core/hle/kernel/process.h" |
| 15 | #include "core/hle/kernel/resource_limit.h" | 16 | #include "core/hle/kernel/resource_limit.h" |
| 16 | #include "core/hle/service/filesystem/filesystem.h" | 17 | #include "core/hle/service/filesystem/filesystem.h" |
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 3702a8478..120e1e133 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include "common/file_util.h" | 10 | #include "common/file_util.h" |
| 11 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 12 | #include "core/core.h" | 12 | #include "core/core.h" |
| 13 | #include "core/hle/kernel/kernel.h" | ||
| 13 | #include "core/hle/kernel/process.h" | 14 | #include "core/hle/kernel/process.h" |
| 14 | #include "core/hle/kernel/resource_limit.h" | 15 | #include "core/hle/kernel/resource_limit.h" |
| 15 | #include "core/loader/elf.h" | 16 | #include "core/loader/elf.h" |
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp index 00205d1d2..77026b850 100644 --- a/src/core/loader/nro.cpp +++ b/src/core/loader/nro.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "core/file_sys/control_metadata.h" | 14 | #include "core/file_sys/control_metadata.h" |
| 15 | #include "core/file_sys/vfs_offset.h" | 15 | #include "core/file_sys/vfs_offset.h" |
| 16 | #include "core/gdbstub/gdbstub.h" | 16 | #include "core/gdbstub/gdbstub.h" |
| 17 | #include "core/hle/kernel/kernel.h" | ||
| 17 | #include "core/hle/kernel/process.h" | 18 | #include "core/hle/kernel/process.h" |
| 18 | #include "core/hle/kernel/resource_limit.h" | 19 | #include "core/hle/kernel/resource_limit.h" |
| 19 | #include "core/loader/nro.h" | 20 | #include "core/loader/nro.h" |
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 0c992d662..082a95d40 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "common/swap.h" | 11 | #include "common/swap.h" |
| 12 | #include "core/core.h" | 12 | #include "core/core.h" |
| 13 | #include "core/gdbstub/gdbstub.h" | 13 | #include "core/gdbstub/gdbstub.h" |
| 14 | #include "core/hle/kernel/kernel.h" | ||
| 14 | #include "core/hle/kernel/process.h" | 15 | #include "core/hle/kernel/process.h" |
| 15 | #include "core/hle/kernel/resource_limit.h" | 16 | #include "core/hle/kernel/resource_limit.h" |
| 16 | #include "core/loader/nso.h" | 17 | #include "core/loader/nso.h" |
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 93d23de21..7d95816fe 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -40,7 +40,7 @@ void PerfStats::EndGameFrame() { | |||
| 40 | game_frames += 1; | 40 | game_frames += 1; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | PerfStats::Results PerfStats::GetAndResetStats(microseconds current_system_time_us) { | 43 | PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us) { |
| 44 | std::lock_guard<std::mutex> lock(object_mutex); | 44 | std::lock_guard<std::mutex> lock(object_mutex); |
| 45 | 45 | ||
| 46 | const auto now = Clock::now(); | 46 | const auto now = Clock::now(); |
| @@ -49,7 +49,7 @@ PerfStats::Results PerfStats::GetAndResetStats(microseconds current_system_time_ | |||
| 49 | 49 | ||
| 50 | const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; | 50 | const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; |
| 51 | 51 | ||
| 52 | Results results{}; | 52 | PerfStatsResults results{}; |
| 53 | results.system_fps = static_cast<double>(system_frames) / interval; | 53 | results.system_fps = static_cast<double>(system_frames) / interval; |
| 54 | results.game_fps = static_cast<double>(game_frames) / interval; | 54 | results.game_fps = static_cast<double>(game_frames) / interval; |
| 55 | results.frametime = duration_cast<DoubleSecs>(accumulated_frametime).count() / | 55 | results.frametime = duration_cast<DoubleSecs>(accumulated_frametime).count() / |
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h index 6e4619701..222ac1a63 100644 --- a/src/core/perf_stats.h +++ b/src/core/perf_stats.h | |||
| @@ -10,6 +10,17 @@ | |||
| 10 | 10 | ||
| 11 | namespace Core { | 11 | namespace Core { |
| 12 | 12 | ||
| 13 | struct PerfStatsResults { | ||
| 14 | /// System FPS (LCD VBlanks) in Hz | ||
| 15 | double system_fps; | ||
| 16 | /// Game FPS (GSP frame submissions) in Hz | ||
| 17 | double game_fps; | ||
| 18 | /// Walltime per system frame, in seconds, excluding any waits | ||
| 19 | double frametime; | ||
| 20 | /// Ratio of walltime / emulated time elapsed | ||
| 21 | double emulation_speed; | ||
| 22 | }; | ||
| 23 | |||
| 13 | /** | 24 | /** |
| 14 | * Class to manage and query performance/timing statistics. All public functions of this class are | 25 | * Class to manage and query performance/timing statistics. All public functions of this class are |
| 15 | * thread-safe unless stated otherwise. | 26 | * thread-safe unless stated otherwise. |
| @@ -18,22 +29,11 @@ class PerfStats { | |||
| 18 | public: | 29 | public: |
| 19 | using Clock = std::chrono::high_resolution_clock; | 30 | using Clock = std::chrono::high_resolution_clock; |
| 20 | 31 | ||
| 21 | struct Results { | ||
| 22 | /// System FPS (LCD VBlanks) in Hz | ||
| 23 | double system_fps; | ||
| 24 | /// Game FPS (GSP frame submissions) in Hz | ||
| 25 | double game_fps; | ||
| 26 | /// Walltime per system frame, in seconds, excluding any waits | ||
| 27 | double frametime; | ||
| 28 | /// Ratio of walltime / emulated time elapsed | ||
| 29 | double emulation_speed; | ||
| 30 | }; | ||
| 31 | |||
| 32 | void BeginSystemFrame(); | 32 | void BeginSystemFrame(); |
| 33 | void EndSystemFrame(); | 33 | void EndSystemFrame(); |
| 34 | void EndGameFrame(); | 34 | void EndGameFrame(); |
| 35 | 35 | ||
| 36 | Results GetAndResetStats(std::chrono::microseconds current_system_time_us); | 36 | PerfStatsResults GetAndResetStats(std::chrono::microseconds current_system_time_us); |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * Gets the ratio between walltime and the emulated time of the previous system frame. This is | 39 | * Gets the ratio between walltime and the emulated time of the previous system frame. This is |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 827a1bbd0..65571b948 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "common/file_util.h" | 7 | #include "common/file_util.h" |
| 8 | 8 | ||
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/loader/loader.h" | ||
| 10 | #include "core/settings.h" | 11 | #include "core/settings.h" |
| 11 | #include "core/telemetry_session.h" | 12 | #include "core/telemetry_session.h" |
| 12 | 13 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index f32a79d7b..68ff1e86b 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -5,13 +5,12 @@ | |||
| 5 | #include <cinttypes> | 5 | #include <cinttypes> |
| 6 | #include "common/assert.h" | 6 | #include "common/assert.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/memory.h" | ||
| 8 | #include "video_core/debug_utils/debug_utils.h" | 9 | #include "video_core/debug_utils/debug_utils.h" |
| 9 | #include "video_core/engines/maxwell_3d.h" | 10 | #include "video_core/engines/maxwell_3d.h" |
| 10 | #include "video_core/rasterizer_interface.h" | 11 | #include "video_core/rasterizer_interface.h" |
| 11 | #include "video_core/renderer_base.h" | 12 | #include "video_core/renderer_base.h" |
| 12 | #include "video_core/textures/decoders.h" | ||
| 13 | #include "video_core/textures/texture.h" | 13 | #include "video_core/textures/texture.h" |
| 14 | #include "video_core/video_core.h" | ||
| 15 | 14 | ||
| 16 | namespace Tegra { | 15 | namespace Tegra { |
| 17 | namespace Engines { | 16 | namespace Engines { |
diff --git a/src/video_core/rasterizer_cache.h b/src/video_core/rasterizer_cache.h index de1eab86b..083b283b0 100644 --- a/src/video_core/rasterizer_cache.h +++ b/src/video_core/rasterizer_cache.h | |||
| @@ -7,11 +7,10 @@ | |||
| 7 | #include <set> | 7 | #include <set> |
| 8 | 8 | ||
| 9 | #include <boost/icl/interval_map.hpp> | 9 | #include <boost/icl/interval_map.hpp> |
| 10 | #include <boost/range/iterator_range_core.hpp> | ||
| 10 | 11 | ||
| 11 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 12 | #include "core/core.h" | 13 | #include "core/core.h" |
| 13 | #include "core/memory.h" | ||
| 14 | #include "video_core/memory_manager.h" | ||
| 15 | #include "video_core/rasterizer_interface.h" | 14 | #include "video_core/rasterizer_interface.h" |
| 16 | #include "video_core/renderer_base.h" | 15 | #include "video_core/renderer_base.h" |
| 17 | 16 | ||
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 3c4a9f17c..411a73d50 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -10,12 +10,14 @@ | |||
| 10 | #include <glad/glad.h> | 10 | #include <glad/glad.h> |
| 11 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/telemetry.h" | ||
| 13 | #include "core/core.h" | 14 | #include "core/core.h" |
| 14 | #include "core/core_timing.h" | 15 | #include "core/core_timing.h" |
| 15 | #include "core/frontend/emu_window.h" | 16 | #include "core/frontend/emu_window.h" |
| 16 | #include "core/memory.h" | 17 | #include "core/memory.h" |
| 17 | #include "core/perf_stats.h" | 18 | #include "core/perf_stats.h" |
| 18 | #include "core/settings.h" | 19 | #include "core/settings.h" |
| 20 | #include "core/telemetry_session.h" | ||
| 19 | #include "core/tracer/recorder.h" | 21 | #include "core/tracer/recorder.h" |
| 20 | #include "video_core/renderer_opengl/gl_rasterizer.h" | 22 | #include "video_core/renderer_opengl/gl_rasterizer.h" |
| 21 | #include "video_core/renderer_opengl/renderer_opengl.h" | 23 | #include "video_core/renderer_opengl/renderer_opengl.h" |
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index eac0c05f2..6c2cd967e 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp | |||
| @@ -9,11 +9,14 @@ | |||
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/hle/kernel/event.h" | 10 | #include "core/hle/kernel/event.h" |
| 11 | #include "core/hle/kernel/handle_table.h" | 11 | #include "core/hle/kernel/handle_table.h" |
| 12 | #include "core/hle/kernel/kernel.h" | ||
| 12 | #include "core/hle/kernel/mutex.h" | 13 | #include "core/hle/kernel/mutex.h" |
| 14 | #include "core/hle/kernel/scheduler.h" | ||
| 13 | #include "core/hle/kernel/thread.h" | 15 | #include "core/hle/kernel/thread.h" |
| 14 | #include "core/hle/kernel/timer.h" | 16 | #include "core/hle/kernel/timer.h" |
| 15 | #include "core/hle/kernel/wait_object.h" | 17 | #include "core/hle/kernel/wait_object.h" |
| 16 | 18 | ||
| 19 | WaitTreeItem::WaitTreeItem() = default; | ||
| 17 | WaitTreeItem::~WaitTreeItem() = default; | 20 | WaitTreeItem::~WaitTreeItem() = default; |
| 18 | 21 | ||
| 19 | QColor WaitTreeItem::GetColor() const { | 22 | QColor WaitTreeItem::GetColor() const { |
| @@ -71,6 +74,7 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList() | |||
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | WaitTreeText::WaitTreeText(const QString& t) : text(t) {} | 76 | WaitTreeText::WaitTreeText(const QString& t) : text(t) {} |
| 77 | WaitTreeText::~WaitTreeText() = default; | ||
| 74 | 78 | ||
| 75 | QString WaitTreeText::GetText() const { | 79 | QString WaitTreeText::GetText() const { |
| 76 | return text; | 80 | return text; |
| @@ -84,6 +88,8 @@ WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address) : mutex_address(mutex_ | |||
| 84 | owner = handle_table.Get<Kernel::Thread>(owner_handle); | 88 | owner = handle_table.Get<Kernel::Thread>(owner_handle); |
| 85 | } | 89 | } |
| 86 | 90 | ||
| 91 | WaitTreeMutexInfo::~WaitTreeMutexInfo() = default; | ||
| 92 | |||
| 87 | QString WaitTreeMutexInfo::GetText() const { | 93 | QString WaitTreeMutexInfo::GetText() const { |
| 88 | return tr("waiting for mutex 0x%1").arg(mutex_address, 16, 16, QLatin1Char('0')); | 94 | return tr("waiting for mutex 0x%1").arg(mutex_address, 16, 16, QLatin1Char('0')); |
| 89 | } | 95 | } |
| @@ -102,6 +108,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() cons | |||
| 102 | } | 108 | } |
| 103 | 109 | ||
| 104 | WaitTreeCallstack::WaitTreeCallstack(const Kernel::Thread& thread) : thread(thread) {} | 110 | WaitTreeCallstack::WaitTreeCallstack(const Kernel::Thread& thread) : thread(thread) {} |
| 111 | WaitTreeCallstack::~WaitTreeCallstack() = default; | ||
| 105 | 112 | ||
| 106 | QString WaitTreeCallstack::GetText() const { | 113 | QString WaitTreeCallstack::GetText() const { |
| 107 | return tr("Call stack"); | 114 | return tr("Call stack"); |
| @@ -126,6 +133,10 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons | |||
| 126 | } | 133 | } |
| 127 | 134 | ||
| 128 | WaitTreeWaitObject::WaitTreeWaitObject(const Kernel::WaitObject& o) : object(o) {} | 135 | WaitTreeWaitObject::WaitTreeWaitObject(const Kernel::WaitObject& o) : object(o) {} |
| 136 | WaitTreeWaitObject::~WaitTreeWaitObject() = default; | ||
| 137 | |||
| 138 | WaitTreeExpandableItem::WaitTreeExpandableItem() = default; | ||
| 139 | WaitTreeExpandableItem::~WaitTreeExpandableItem() = default; | ||
| 129 | 140 | ||
| 130 | bool WaitTreeExpandableItem::IsExpandable() const { | 141 | bool WaitTreeExpandableItem::IsExpandable() const { |
| 131 | return true; | 142 | return true; |
| @@ -180,6 +191,8 @@ WaitTreeObjectList::WaitTreeObjectList( | |||
| 180 | const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all) | 191 | const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all) |
| 181 | : object_list(list), wait_all(w_all) {} | 192 | : object_list(list), wait_all(w_all) {} |
| 182 | 193 | ||
| 194 | WaitTreeObjectList::~WaitTreeObjectList() = default; | ||
| 195 | |||
| 183 | QString WaitTreeObjectList::GetText() const { | 196 | QString WaitTreeObjectList::GetText() const { |
| 184 | if (wait_all) | 197 | if (wait_all) |
| 185 | return tr("waiting for all objects"); | 198 | return tr("waiting for all objects"); |
| @@ -194,6 +207,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeObjectList::GetChildren() con | |||
| 194 | } | 207 | } |
| 195 | 208 | ||
| 196 | WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) : WaitTreeWaitObject(thread) {} | 209 | WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) : WaitTreeWaitObject(thread) {} |
| 210 | WaitTreeThread::~WaitTreeThread() = default; | ||
| 197 | 211 | ||
| 198 | QString WaitTreeThread::GetText() const { | 212 | QString WaitTreeThread::GetText() const { |
| 199 | const auto& thread = static_cast<const Kernel::Thread&>(object); | 213 | const auto& thread = static_cast<const Kernel::Thread&>(object); |
| @@ -312,6 +326,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { | |||
| 312 | } | 326 | } |
| 313 | 327 | ||
| 314 | WaitTreeEvent::WaitTreeEvent(const Kernel::Event& object) : WaitTreeWaitObject(object) {} | 328 | WaitTreeEvent::WaitTreeEvent(const Kernel::Event& object) : WaitTreeWaitObject(object) {} |
| 329 | WaitTreeEvent::~WaitTreeEvent() = default; | ||
| 315 | 330 | ||
| 316 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const { | 331 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const { |
| 317 | std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); | 332 | std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); |
| @@ -323,6 +338,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const { | |||
| 323 | } | 338 | } |
| 324 | 339 | ||
| 325 | WaitTreeTimer::WaitTreeTimer(const Kernel::Timer& object) : WaitTreeWaitObject(object) {} | 340 | WaitTreeTimer::WaitTreeTimer(const Kernel::Timer& object) : WaitTreeWaitObject(object) {} |
| 341 | WaitTreeTimer::~WaitTreeTimer() = default; | ||
| 326 | 342 | ||
| 327 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeTimer::GetChildren() const { | 343 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeTimer::GetChildren() const { |
| 328 | std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); | 344 | std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); |
| @@ -340,6 +356,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeTimer::GetChildren() const { | |||
| 340 | 356 | ||
| 341 | WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list) | 357 | WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list) |
| 342 | : thread_list(list) {} | 358 | : thread_list(list) {} |
| 359 | WaitTreeThreadList::~WaitTreeThreadList() = default; | ||
| 343 | 360 | ||
| 344 | QString WaitTreeThreadList::GetText() const { | 361 | QString WaitTreeThreadList::GetText() const { |
| 345 | return tr("waited by thread"); | 362 | return tr("waited by thread"); |
| @@ -353,6 +370,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThreadList::GetChildren() con | |||
| 353 | } | 370 | } |
| 354 | 371 | ||
| 355 | WaitTreeModel::WaitTreeModel(QObject* parent) : QAbstractItemModel(parent) {} | 372 | WaitTreeModel::WaitTreeModel(QObject* parent) : QAbstractItemModel(parent) {} |
| 373 | WaitTreeModel::~WaitTreeModel() = default; | ||
| 356 | 374 | ||
| 357 | QModelIndex WaitTreeModel::index(int row, int column, const QModelIndex& parent) const { | 375 | QModelIndex WaitTreeModel::index(int row, int column, const QModelIndex& parent) const { |
| 358 | if (!hasIndex(row, column, parent)) | 376 | if (!hasIndex(row, column, parent)) |
| @@ -421,6 +439,8 @@ WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), p | |||
| 421 | setEnabled(false); | 439 | setEnabled(false); |
| 422 | } | 440 | } |
| 423 | 441 | ||
| 442 | WaitTreeWidget::~WaitTreeWidget() = default; | ||
| 443 | |||
| 424 | void WaitTreeWidget::OnDebugModeEntered() { | 444 | void WaitTreeWidget::OnDebugModeEntered() { |
| 425 | if (!Core::System::GetInstance().IsPoweredOn()) | 445 | if (!Core::System::GetInstance().IsPoweredOn()) |
| 426 | return; | 446 | return; |
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index 513b3c45d..defbf734f 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h | |||
| @@ -4,11 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <cstddef> | ||
| 8 | #include <memory> | ||
| 9 | #include <vector> | ||
| 10 | |||
| 7 | #include <QAbstractItemModel> | 11 | #include <QAbstractItemModel> |
| 8 | #include <QDockWidget> | 12 | #include <QDockWidget> |
| 9 | #include <QTreeView> | 13 | #include <QTreeView> |
| 10 | #include <boost/container/flat_set.hpp> | 14 | #include <boost/container/flat_set.hpp> |
| 11 | #include "core/core.h" | 15 | #include "common/common_types.h" |
| 12 | #include "core/hle/kernel/object.h" | 16 | #include "core/hle/kernel/object.h" |
| 13 | 17 | ||
| 14 | class EmuThread; | 18 | class EmuThread; |
| @@ -25,6 +29,7 @@ class WaitTreeThread; | |||
| 25 | class WaitTreeItem : public QObject { | 29 | class WaitTreeItem : public QObject { |
| 26 | Q_OBJECT | 30 | Q_OBJECT |
| 27 | public: | 31 | public: |
| 32 | WaitTreeItem(); | ||
| 28 | ~WaitTreeItem() override; | 33 | ~WaitTreeItem() override; |
| 29 | 34 | ||
| 30 | virtual bool IsExpandable() const; | 35 | virtual bool IsExpandable() const; |
| @@ -49,6 +54,8 @@ class WaitTreeText : public WaitTreeItem { | |||
| 49 | Q_OBJECT | 54 | Q_OBJECT |
| 50 | public: | 55 | public: |
| 51 | explicit WaitTreeText(const QString& text); | 56 | explicit WaitTreeText(const QString& text); |
| 57 | ~WaitTreeText() override; | ||
| 58 | |||
| 52 | QString GetText() const override; | 59 | QString GetText() const override; |
| 53 | 60 | ||
| 54 | private: | 61 | private: |
| @@ -58,6 +65,9 @@ private: | |||
| 58 | class WaitTreeExpandableItem : public WaitTreeItem { | 65 | class WaitTreeExpandableItem : public WaitTreeItem { |
| 59 | Q_OBJECT | 66 | Q_OBJECT |
| 60 | public: | 67 | public: |
| 68 | WaitTreeExpandableItem(); | ||
| 69 | ~WaitTreeExpandableItem() override; | ||
| 70 | |||
| 61 | bool IsExpandable() const override; | 71 | bool IsExpandable() const override; |
| 62 | }; | 72 | }; |
| 63 | 73 | ||
| @@ -65,6 +75,8 @@ class WaitTreeMutexInfo : public WaitTreeExpandableItem { | |||
| 65 | Q_OBJECT | 75 | Q_OBJECT |
| 66 | public: | 76 | public: |
| 67 | explicit WaitTreeMutexInfo(VAddr mutex_address); | 77 | explicit WaitTreeMutexInfo(VAddr mutex_address); |
| 78 | ~WaitTreeMutexInfo() override; | ||
| 79 | |||
| 68 | QString GetText() const override; | 80 | QString GetText() const override; |
| 69 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 81 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 70 | 82 | ||
| @@ -79,6 +91,8 @@ class WaitTreeCallstack : public WaitTreeExpandableItem { | |||
| 79 | Q_OBJECT | 91 | Q_OBJECT |
| 80 | public: | 92 | public: |
| 81 | explicit WaitTreeCallstack(const Kernel::Thread& thread); | 93 | explicit WaitTreeCallstack(const Kernel::Thread& thread); |
| 94 | ~WaitTreeCallstack() override; | ||
| 95 | |||
| 82 | QString GetText() const override; | 96 | QString GetText() const override; |
| 83 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 97 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 84 | 98 | ||
| @@ -90,6 +104,8 @@ class WaitTreeWaitObject : public WaitTreeExpandableItem { | |||
| 90 | Q_OBJECT | 104 | Q_OBJECT |
| 91 | public: | 105 | public: |
| 92 | explicit WaitTreeWaitObject(const Kernel::WaitObject& object); | 106 | explicit WaitTreeWaitObject(const Kernel::WaitObject& object); |
| 107 | ~WaitTreeWaitObject() override; | ||
| 108 | |||
| 93 | static std::unique_ptr<WaitTreeWaitObject> make(const Kernel::WaitObject& object); | 109 | static std::unique_ptr<WaitTreeWaitObject> make(const Kernel::WaitObject& object); |
| 94 | QString GetText() const override; | 110 | QString GetText() const override; |
| 95 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 111 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| @@ -105,6 +121,8 @@ class WaitTreeObjectList : public WaitTreeExpandableItem { | |||
| 105 | public: | 121 | public: |
| 106 | WaitTreeObjectList(const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, | 122 | WaitTreeObjectList(const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, |
| 107 | bool wait_all); | 123 | bool wait_all); |
| 124 | ~WaitTreeObjectList() override; | ||
| 125 | |||
| 108 | QString GetText() const override; | 126 | QString GetText() const override; |
| 109 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 127 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 110 | 128 | ||
| @@ -117,6 +135,8 @@ class WaitTreeThread : public WaitTreeWaitObject { | |||
| 117 | Q_OBJECT | 135 | Q_OBJECT |
| 118 | public: | 136 | public: |
| 119 | explicit WaitTreeThread(const Kernel::Thread& thread); | 137 | explicit WaitTreeThread(const Kernel::Thread& thread); |
| 138 | ~WaitTreeThread() override; | ||
| 139 | |||
| 120 | QString GetText() const override; | 140 | QString GetText() const override; |
| 121 | QColor GetColor() const override; | 141 | QColor GetColor() const override; |
| 122 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 142 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| @@ -126,6 +146,8 @@ class WaitTreeEvent : public WaitTreeWaitObject { | |||
| 126 | Q_OBJECT | 146 | Q_OBJECT |
| 127 | public: | 147 | public: |
| 128 | explicit WaitTreeEvent(const Kernel::Event& object); | 148 | explicit WaitTreeEvent(const Kernel::Event& object); |
| 149 | ~WaitTreeEvent() override; | ||
| 150 | |||
| 129 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 151 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 130 | }; | 152 | }; |
| 131 | 153 | ||
| @@ -133,6 +155,8 @@ class WaitTreeTimer : public WaitTreeWaitObject { | |||
| 133 | Q_OBJECT | 155 | Q_OBJECT |
| 134 | public: | 156 | public: |
| 135 | explicit WaitTreeTimer(const Kernel::Timer& object); | 157 | explicit WaitTreeTimer(const Kernel::Timer& object); |
| 158 | ~WaitTreeTimer() override; | ||
| 159 | |||
| 136 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 160 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 137 | }; | 161 | }; |
| 138 | 162 | ||
| @@ -140,6 +164,8 @@ class WaitTreeThreadList : public WaitTreeExpandableItem { | |||
| 140 | Q_OBJECT | 164 | Q_OBJECT |
| 141 | public: | 165 | public: |
| 142 | explicit WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list); | 166 | explicit WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list); |
| 167 | ~WaitTreeThreadList() override; | ||
| 168 | |||
| 143 | QString GetText() const override; | 169 | QString GetText() const override; |
| 144 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | 170 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; |
| 145 | 171 | ||
| @@ -152,6 +178,7 @@ class WaitTreeModel : public QAbstractItemModel { | |||
| 152 | 178 | ||
| 153 | public: | 179 | public: |
| 154 | explicit WaitTreeModel(QObject* parent = nullptr); | 180 | explicit WaitTreeModel(QObject* parent = nullptr); |
| 181 | ~WaitTreeModel() override; | ||
| 155 | 182 | ||
| 156 | QVariant data(const QModelIndex& index, int role) const override; | 183 | QVariant data(const QModelIndex& index, int role) const override; |
| 157 | QModelIndex index(int row, int column, const QModelIndex& parent) const override; | 184 | QModelIndex index(int row, int column, const QModelIndex& parent) const override; |
| @@ -171,6 +198,7 @@ class WaitTreeWidget : public QDockWidget { | |||
| 171 | 198 | ||
| 172 | public: | 199 | public: |
| 173 | explicit WaitTreeWidget(QWidget* parent = nullptr); | 200 | explicit WaitTreeWidget(QWidget* parent = nullptr); |
| 201 | ~WaitTreeWidget() override; | ||
| 174 | 202 | ||
| 175 | public slots: | 203 | public slots: |
| 176 | void OnDebugModeEntered(); | 204 | void OnDebugModeEntered(); |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 27525938a..d15242d59 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -23,10 +23,12 @@ | |||
| 23 | #include "core/file_sys/registered_cache.h" | 23 | #include "core/file_sys/registered_cache.h" |
| 24 | #include "core/file_sys/romfs.h" | 24 | #include "core/file_sys/romfs.h" |
| 25 | #include "core/file_sys/vfs_real.h" | 25 | #include "core/file_sys/vfs_real.h" |
| 26 | #include "core/hle/service/filesystem/filesystem.h" | ||
| 26 | #include "core/loader/loader.h" | 27 | #include "core/loader/loader.h" |
| 27 | #include "game_list.h" | 28 | #include "yuzu/game_list.h" |
| 28 | #include "game_list_p.h" | 29 | #include "yuzu/game_list_p.h" |
| 29 | #include "ui_settings.h" | 30 | #include "yuzu/main.h" |
| 31 | #include "yuzu/ui_settings.h" | ||
| 30 | 32 | ||
| 31 | GameList::SearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {} | 33 | GameList::SearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {} |
| 32 | 34 | ||
| @@ -481,6 +483,14 @@ static void GetMetadataFromControlNCA(const std::shared_ptr<FileSys::NCA>& nca, | |||
| 481 | } | 483 | } |
| 482 | } | 484 | } |
| 483 | 485 | ||
| 486 | GameListWorker::GameListWorker( | ||
| 487 | FileSys::VirtualFilesystem vfs, QString dir_path, bool deep_scan, | ||
| 488 | const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list) | ||
| 489 | : vfs(std::move(vfs)), dir_path(std::move(dir_path)), deep_scan(deep_scan), | ||
| 490 | compatibility_list(compatibility_list) {} | ||
| 491 | |||
| 492 | GameListWorker::~GameListWorker() = default; | ||
| 493 | |||
| 484 | void GameListWorker::AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache) { | 494 | void GameListWorker::AddInstalledTitlesToGameList(std::shared_ptr<FileSys::RegisteredCache> cache) { |
| 485 | const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application, | 495 | const auto installed_games = cache->ListEntriesFilter(FileSys::TitleType::Application, |
| 486 | FileSys::ContentRecordType::Program); | 496 | FileSys::ContentRecordType::Program); |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index c01351dc9..6a5c2f5f8 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <unordered_map> | ||
| 8 | |||
| 7 | #include <QFileSystemWatcher> | 9 | #include <QFileSystemWatcher> |
| 8 | #include <QHBoxLayout> | 10 | #include <QHBoxLayout> |
| 9 | #include <QLabel> | 11 | #include <QLabel> |
| @@ -17,9 +19,13 @@ | |||
| 17 | #include <QTreeView> | 19 | #include <QTreeView> |
| 18 | #include <QVBoxLayout> | 20 | #include <QVBoxLayout> |
| 19 | #include <QWidget> | 21 | #include <QWidget> |
| 20 | #include "main.h" | ||
| 21 | 22 | ||
| 22 | class GameListWorker; | 23 | class GameListWorker; |
| 24 | class GMainWindow; | ||
| 25 | |||
| 26 | namespace FileSys { | ||
| 27 | class VfsFilesystem; | ||
| 28 | } | ||
| 23 | 29 | ||
| 24 | enum class GameListOpenTarget { SaveData }; | 30 | enum class GameListOpenTarget { SaveData }; |
| 25 | 31 | ||
| @@ -62,7 +68,7 @@ public: | |||
| 62 | QToolButton* button_filter_close = nullptr; | 68 | QToolButton* button_filter_close = nullptr; |
| 63 | }; | 69 | }; |
| 64 | 70 | ||
| 65 | explicit GameList(FileSys::VirtualFilesystem vfs, GMainWindow* parent = nullptr); | 71 | explicit GameList(std::shared_ptr<FileSys::VfsFilesystem> vfs, GMainWindow* parent = nullptr); |
| 66 | ~GameList() override; | 72 | ~GameList() override; |
| 67 | 73 | ||
| 68 | void clearFilter(); | 74 | void clearFilter(); |
| @@ -97,7 +103,7 @@ private: | |||
| 97 | void PopupContextMenu(const QPoint& menu_location); | 103 | void PopupContextMenu(const QPoint& menu_location); |
| 98 | void RefreshGameDirectory(); | 104 | void RefreshGameDirectory(); |
| 99 | 105 | ||
| 100 | FileSys::VirtualFilesystem vfs; | 106 | std::shared_ptr<FileSys::VfsFilesystem> vfs; |
| 101 | SearchField* search_field; | 107 | SearchField* search_field; |
| 102 | GMainWindow* main_window = nullptr; | 108 | GMainWindow* main_window = nullptr; |
| 103 | QVBoxLayout* layout = nullptr; | 109 | QVBoxLayout* layout = nullptr; |
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index b9676d069..3624cb21a 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -18,10 +18,15 @@ | |||
| 18 | #include <QString> | 18 | #include <QString> |
| 19 | #include "common/logging/log.h" | 19 | #include "common/logging/log.h" |
| 20 | #include "common/string_util.h" | 20 | #include "common/string_util.h" |
| 21 | #include "core/file_sys/content_archive.h" | 21 | #include "yuzu/ui_settings.h" |
| 22 | #include "ui_settings.h" | ||
| 23 | #include "yuzu/util/util.h" | 22 | #include "yuzu/util/util.h" |
| 24 | 23 | ||
| 24 | namespace FileSys { | ||
| 25 | class NCA; | ||
| 26 | class RegisteredCache; | ||
| 27 | class VfsFilesystem; | ||
| 28 | } // namespace FileSys | ||
| 29 | |||
| 25 | /** | 30 | /** |
| 26 | * Gets the default icon (for games without valid SMDH) | 31 | * Gets the default icon (for games without valid SMDH) |
| 27 | * @param large If true, returns large icon (48x48), otherwise returns small icon (24x24) | 32 | * @param large If true, returns large icon (48x48), otherwise returns small icon (24x24) |
| @@ -196,10 +201,9 @@ class GameListWorker : public QObject, public QRunnable { | |||
| 196 | 201 | ||
| 197 | public: | 202 | public: |
| 198 | GameListWorker( | 203 | GameListWorker( |
| 199 | FileSys::VirtualFilesystem vfs, QString dir_path, bool deep_scan, | 204 | std::shared_ptr<FileSys::VfsFilesystem> vfs, QString dir_path, bool deep_scan, |
| 200 | const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list) | 205 | const std::unordered_map<std::string, std::pair<QString, QString>>& compatibility_list); |
| 201 | : vfs(std::move(vfs)), dir_path(std::move(dir_path)), deep_scan(deep_scan), | 206 | ~GameListWorker() override; |
| 202 | compatibility_list(compatibility_list) {} | ||
| 203 | 207 | ||
| 204 | public slots: | 208 | public slots: |
| 205 | /// Starts the processing of directory tree information. | 209 | /// Starts the processing of directory tree information. |
| @@ -222,7 +226,7 @@ signals: | |||
| 222 | void Finished(QStringList watch_list); | 226 | void Finished(QStringList watch_list); |
| 223 | 227 | ||
| 224 | private: | 228 | private: |
| 225 | FileSys::VirtualFilesystem vfs; | 229 | std::shared_ptr<FileSys::VfsFilesystem> vfs; |
| 226 | std::map<u64, std::shared_ptr<FileSys::NCA>> nca_control_map; | 230 | std::map<u64, std::shared_ptr<FileSys::NCA>> nca_control_map; |
| 227 | QStringList watch_list; | 231 | QStringList watch_list; |
| 228 | QString dir_path; | 232 | QString dir_path; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 1501aedc4..e11ba7854 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -21,22 +21,22 @@ | |||
| 21 | #include "common/logging/backend.h" | 21 | #include "common/logging/backend.h" |
| 22 | #include "common/logging/filter.h" | 22 | #include "common/logging/filter.h" |
| 23 | #include "common/logging/log.h" | 23 | #include "common/logging/log.h" |
| 24 | #include "common/logging/text_formatter.h" | ||
| 25 | #include "common/microprofile.h" | 24 | #include "common/microprofile.h" |
| 26 | #include "common/scm_rev.h" | 25 | #include "common/scm_rev.h" |
| 27 | #include "common/scope_exit.h" | 26 | #include "common/scope_exit.h" |
| 28 | #include "common/string_util.h" | 27 | #include "common/string_util.h" |
| 28 | #include "common/telemetry.h" | ||
| 29 | #include "core/core.h" | 29 | #include "core/core.h" |
| 30 | #include "core/crypto/key_manager.h" | 30 | #include "core/crypto/key_manager.h" |
| 31 | #include "core/file_sys/bis_factory.h" | ||
| 32 | #include "core/file_sys/card_image.h" | 31 | #include "core/file_sys/card_image.h" |
| 33 | #include "core/file_sys/registered_cache.h" | 32 | #include "core/file_sys/registered_cache.h" |
| 34 | #include "core/file_sys/savedata_factory.h" | 33 | #include "core/file_sys/savedata_factory.h" |
| 35 | #include "core/file_sys/vfs_real.h" | 34 | #include "core/file_sys/vfs_real.h" |
| 36 | #include "core/gdbstub/gdbstub.h" | 35 | #include "core/hle/service/filesystem/filesystem.h" |
| 37 | #include "core/loader/loader.h" | 36 | #include "core/loader/loader.h" |
| 37 | #include "core/perf_stats.h" | ||
| 38 | #include "core/settings.h" | 38 | #include "core/settings.h" |
| 39 | #include "game_list_p.h" | 39 | #include "core/telemetry_session.h" |
| 40 | #include "video_core/debug_utils/debug_utils.h" | 40 | #include "video_core/debug_utils/debug_utils.h" |
| 41 | #include "yuzu/about_dialog.h" | 41 | #include "yuzu/about_dialog.h" |
| 42 | #include "yuzu/bootmanager.h" | 42 | #include "yuzu/bootmanager.h" |
| @@ -48,6 +48,7 @@ | |||
| 48 | #include "yuzu/debugger/profiler.h" | 48 | #include "yuzu/debugger/profiler.h" |
| 49 | #include "yuzu/debugger/wait_tree.h" | 49 | #include "yuzu/debugger/wait_tree.h" |
| 50 | #include "yuzu/game_list.h" | 50 | #include "yuzu/game_list.h" |
| 51 | #include "yuzu/game_list_p.h" | ||
| 51 | #include "yuzu/hotkeys.h" | 52 | #include "yuzu/hotkeys.h" |
| 52 | #include "yuzu/main.h" | 53 | #include "yuzu/main.h" |
| 53 | #include "yuzu/ui_settings.h" | 54 | #include "yuzu/ui_settings.h" |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index fd2436f4d..0b97e8220 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <unordered_map> | ||
| 8 | #include <QMainWindow> | 9 | #include <QMainWindow> |
| 9 | #include <QTimer> | 10 | #include <QTimer> |
| 10 | #include "core/core.h" | 11 | #include "core/core.h" |
| @@ -23,6 +24,10 @@ class ProfilerWidget; | |||
| 23 | class WaitTreeWidget; | 24 | class WaitTreeWidget; |
| 24 | enum class GameListOpenTarget; | 25 | enum class GameListOpenTarget; |
| 25 | 26 | ||
| 27 | namespace FileSys { | ||
| 28 | class VfsFilesystem; | ||
| 29 | } | ||
| 30 | |||
| 26 | namespace Tegra { | 31 | namespace Tegra { |
| 27 | class DebugContext; | 32 | class DebugContext; |
| 28 | } | 33 | } |
| @@ -169,7 +174,7 @@ private: | |||
| 169 | QString game_path; | 174 | QString game_path; |
| 170 | 175 | ||
| 171 | // FS | 176 | // FS |
| 172 | FileSys::VirtualFilesystem vfs; | 177 | std::shared_ptr<FileSys::VfsFilesystem> vfs; |
| 173 | 178 | ||
| 174 | // Debugger panes | 179 | // Debugger panes |
| 175 | ProfilerWidget* profilerWidget; | 180 | ProfilerWidget* profilerWidget; |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 9095cf27d..41e7da897 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -17,10 +17,13 @@ | |||
| 17 | #include "common/scm_rev.h" | 17 | #include "common/scm_rev.h" |
| 18 | #include "common/scope_exit.h" | 18 | #include "common/scope_exit.h" |
| 19 | #include "common/string_util.h" | 19 | #include "common/string_util.h" |
| 20 | #include "common/telemetry.h" | ||
| 20 | #include "core/core.h" | 21 | #include "core/core.h" |
| 22 | #include "core/file_sys/vfs_real.h" | ||
| 21 | #include "core/gdbstub/gdbstub.h" | 23 | #include "core/gdbstub/gdbstub.h" |
| 22 | #include "core/loader/loader.h" | 24 | #include "core/loader/loader.h" |
| 23 | #include "core/settings.h" | 25 | #include "core/settings.h" |
| 26 | #include "core/telemetry_session.h" | ||
| 24 | #include "yuzu_cmd/config.h" | 27 | #include "yuzu_cmd/config.h" |
| 25 | #include "yuzu_cmd/emu_window/emu_window_sdl2.h" | 28 | #include "yuzu_cmd/emu_window/emu_window_sdl2.h" |
| 26 | 29 | ||