From 8b0144dbfcc70b837a39e5905ab9f3c5c6c253b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 18 Feb 2026 10:14:37 +0100 Subject: [PATCH] Get libretro integration working again. - Fixes #21275 - Fixes #21274 --- Core/System.cpp | 5 +++++ libretro/LibretroVulkanContext.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Core/System.cpp b/Core/System.cpp index 385048e367..9e1817fc71 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -600,11 +600,16 @@ bool PSP_InitStart(const CoreParameter &coreParam) { Draw::DrawContext *draw = g_CoreParameter.graphicsContext ? g_CoreParameter.graphicsContext->GetDrawContext() : nullptr; GPUCore gpuCore = g_CoreParameter.gpuCore; + + // In libretro, the creation order is different, it's ok with a null draw context here. + // We do need to rework the whole init process.. ugh. +#ifndef __LIBRETRO__ if (!draw && gpuCore != GPUCORE_SOFTWARE) { ERROR_LOG(Log::Loader, "No drawing context provided."); g_bootState = BootState::Failed; return false; } +#endif g_CoreParameter.errorString.clear(); diff --git a/libretro/LibretroVulkanContext.cpp b/libretro/LibretroVulkanContext.cpp index 6c1b423ad4..bba79794c7 100644 --- a/libretro/LibretroVulkanContext.cpp +++ b/libretro/LibretroVulkanContext.cpp @@ -124,8 +124,10 @@ void LibretroVulkanContext::ContextReset() { void LibretroVulkanContext::ContextDestroy() { INFO_LOG(Log::G3D, "LibretroVulkanContext::ContextDestroy()"); - vk->WaitUntilQueueIdle(); - LibretroHWRenderContext::ContextDestroy(); + if (vk) { + vk->WaitUntilQueueIdle(); + LibretroHWRenderContext::ContextDestroy(); + } } void LibretroVulkanContext::CreateDrawContext() {