Move more of GPU init to the loader thread. Some log cleanup.

This commit is contained in:
Henrik Rydgård committed 2025-05-15 11:43:37 +02:00
1 parent 9293afa1c0
commit 751e4fad2e
17 files changed
+49 -29

No files matched your search

+18 -14
View File
@@ -577,6 +577,19 @@ bool PSP_InitStart(const CoreParameter &coreParam) {
// Initialize the GPU as far as we can here (do things like load cache files).
if (!gpu) { // should be!
INFO_LOG(Log::Loader, "Starting graphics...");
Draw::DrawContext *draw = g_CoreParameter.graphicsContext ? g_CoreParameter.graphicsContext->GetDrawContext() : nullptr;
// This set the `gpu` global.
GPUCore gpuCore = PSP_CoreParameter().gpuCore;
bool success = GPU_Init(gpuCore, g_CoreParameter.graphicsContext, draw);
if (!success) {
*error_string = "Unable to initialize rendering engine.";
CPU_Shutdown(false);
g_bootState = BootState::Failed;
}
}
g_bootState = BootState::Complete;
});
@@ -606,20 +619,11 @@ BootState PSP_InitUpdate(std::string *error_string) {
return BootState::Failed;
}
// Ok, async boot completed, let's finish up things on the main thread.
if (!gpu) { // should be!
INFO_LOG(Log::Loader, "Starting graphics...");
Draw::DrawContext *draw = g_CoreParameter.graphicsContext ? g_CoreParameter.graphicsContext->GetDrawContext() : nullptr;
// This set the `gpu` global.
GPUCore gpuCore = PSP_CoreParameter().gpuCore;
bool success = GPU_Init(gpuCore, g_CoreParameter.graphicsContext, draw);
if (!success) {
*error_string = "Unable to initialize rendering engine.";
PSP_Shutdown(false);
g_bootState = BootState::Off;
Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE);
return BootState::Failed;
}
// Ok, async part of the boot completed, let's finish up things on the main thread.
if (gpu) {
gpu->FinishInitOnMainThread();
} else {
_dbg_assert_(gpu);
}
Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE);