VERY experimental Nintendo Switch 2 emulator
C++
Frontend: Don't call DoneCurrent if the context isnt already current
James Rowee345e46a98a2
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cppindex 4e9ced8baf..eaded2640c 100644--- a/src/yuzu/bootmanager.cpp+++ b/src/yuzu/bootmanager.cpp@@ -141,7 +141,7 @@ public:}~OpenGLSharedContext() {- context->doneCurrent();+ DoneCurrent();}void SwapBuffers() override {@@ -156,6 +156,9 @@ public:}void DoneCurrent() override {+ if (!is_current) {+ return;+ }context->doneCurrent();is_current = false;}diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cppindex ee61179a09..3522dcf6d9 100644--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp@@ -37,16 +37,24 @@ public:}void MakeCurrent() override {- SDL_GL_MakeCurrent(window, context);+ if (is_current) {+ return;+ }+ is_current = SDL_GL_MakeCurrent(window, context) == 0;}void DoneCurrent() override {+ if (!is_current) {+ return;+ }SDL_GL_MakeCurrent(window, nullptr);+ is_current = false;}private:SDL_Window* window;SDL_GLContext context;+ bool is_current = false;};bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() {