From 4cc75d91feaea349c11897a22d659294bc2fd59c Mon Sep 17 00:00:00 2001 From: sonninnos Date: Wed, 5 Jun 2024 04:50:19 +0300 Subject: [PATCH] libretro: Fix opengl detectvsyncswapinterval crash --- libretro/LibretroGraphicsContext.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretro/LibretroGraphicsContext.cpp b/libretro/LibretroGraphicsContext.cpp index 0fd20d41cd..f79c197e9c 100644 --- a/libretro/LibretroGraphicsContext.cpp +++ b/libretro/LibretroGraphicsContext.cpp @@ -42,6 +42,10 @@ LibretroHWRenderContext::LibretroHWRenderContext(retro_hw_context_type context_t void LibretroHWRenderContext::ContextReset() { INFO_LOG(G3D, "Context reset"); + if (gpu && Libretro::useEmuThread) { + Libretro::EmuThreadPause(); + } + if (gpu) { gpu->DeviceLost(); } @@ -57,6 +61,10 @@ void LibretroHWRenderContext::ContextReset() { if (gpu) { gpu->DeviceRestore(draw_); } + + if (gpu && Libretro::useEmuThread) { + Libretro::EmuThreadStart(); + } } void LibretroHWRenderContext::ContextDestroy() {