From 9293afa1c097eff26ab7b9a6d3044663eef877f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 15 May 2025 10:32:07 +0200 Subject: [PATCH] Cleanup --- Core/System.cpp | 10 +--------- GPU/GPUCommon.h | 12 +++++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Core/System.cpp b/Core/System.cpp index 6809d9ed04..abd78a9909 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -617,19 +617,11 @@ BootState PSP_InitUpdate(std::string *error_string) { *error_string = "Unable to initialize rendering engine."; PSP_Shutdown(false); g_bootState = BootState::Off; + Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE); return BootState::Failed; } } - // TODO: This should all be checked during GPU_Init. - if (!GPU_IsStarted()) { - *error_string = "Unable to initialize rendering engine."; - PSP_Shutdown(false); - g_bootState = BootState::Off; - Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE); - return BootState::Failed; - } - Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE); // The thread should have set it at this point. _dbg_assert_(bootState == BootState::Complete); diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 2b4827ac21..15bdf63d89 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -201,12 +201,21 @@ inline bool IsTrianglePrim(GEPrimitiveType prim) { class GPUCommon : public GPUDebugInterface { public: + // The constructor might run on the loader thread. GPUCommon(GraphicsContext *gfxCtx, Draw::DrawContext *draw); + + // FinishInitOnMainThread runs on the main thread, of course. + virtual void FinishInitOnMainThread() {} + virtual ~GPUCommon() {} Draw::DrawContext *GetDrawContext() { return draw_; } + + virtual void DeviceLost() = 0; + virtual void DeviceRestore(Draw::DrawContext *draw) = 0; + virtual u32 CheckGPUFeatures() const = 0; virtual void UpdateCmdInfo() = 0; @@ -257,9 +266,6 @@ public: virtual void ReapplyGfxState(); - virtual void DeviceLost() = 0; - virtual void DeviceRestore(Draw::DrawContext *draw) = 0; - // Returns true if we should split the call across GE execution. // For example, a debugger is active. bool ShouldSplitOverGe() const;