diff --git a/Common/GraphicsContext.h b/Common/GraphicsContext.h index 873722764c..73ebf18a7b 100644 --- a/Common/GraphicsContext.h +++ b/Common/GraphicsContext.h @@ -16,8 +16,6 @@ public: virtual void Shutdown() = 0; virtual void SwapInterval(int interval) = 0; - virtual void SwapBuffers() = 0; - // Used during window resize. Must be called from the window thread, // not the rendering thread or CPU thread. virtual void Pause() {} diff --git a/Core/Core.cpp b/Core/Core.cpp index 60064b176c..4abed1a004 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -227,10 +227,6 @@ void Core_RunLoop(GraphicsContext *ctx) { if (sleepTime > 0) sleep_ms(sleepTime); } - - if ((!windowHidden && !Core_IsStepping()) || menuThrottle) { - ctx->SwapBuffers(); - } } void Core_DoSingleStep() { diff --git a/Qt/QtMain.h b/Qt/QtMain.h index 39cce11f77..d1cf6c7d40 100644 --- a/Qt/QtMain.h +++ b/Qt/QtMain.h @@ -70,7 +70,6 @@ public: // See TODO in constructor. // renderManager_->SwapInterval(interval); } - void SwapBuffers() override {} void Resize() override {} Draw::DrawContext *GetDrawContext() override { diff --git a/SDL/SDLGLGraphicsContext.h b/SDL/SDLGLGraphicsContext.h index 95d627deda..b71b99349a 100644 --- a/SDL/SDLGLGraphicsContext.h +++ b/SDL/SDLGLGraphicsContext.h @@ -19,10 +19,6 @@ public: void Shutdown() override; void ShutdownFromRenderThread() override; - void SwapBuffers() override { - // Do nothing, the render thread takes care of this. - } - // Gets forwarded to the render thread. void SwapInterval(int interval) override; diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 64f7ecec08..86bd191316 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -1452,8 +1452,6 @@ int main(int argc, char *argv[]) { break; } - graphicsContext->SwapBuffers(); - { std::lock_guard guard(g_mutexWindow); if (g_windowState.update) { diff --git a/SDL/SDLVulkanGraphicsContext.h b/SDL/SDLVulkanGraphicsContext.h index d309e685d5..1fe5b0c94f 100644 --- a/SDL/SDLVulkanGraphicsContext.h +++ b/SDL/SDLVulkanGraphicsContext.h @@ -26,10 +26,6 @@ public: void Shutdown() override; - void SwapBuffers() override { - // We don't do it this way. - } - void Resize() override; void Poll() override; diff --git a/UWP/PPSSPP_UWPMain.h b/UWP/PPSSPP_UWPMain.h index 0d51f1bbf1..e2cc2edefc 100644 --- a/UWP/PPSSPP_UWPMain.h +++ b/UWP/PPSSPP_UWPMain.h @@ -20,7 +20,6 @@ public: void Shutdown() override; void SwapInterval(int interval) override {} - void SwapBuffers() override {} void Resize() override {} Draw::DrawContext * GetDrawContext() override { return draw_; diff --git a/Windows/GPU/D3D11Context.h b/Windows/GPU/D3D11Context.h index b7d2baf20e..3d40355899 100644 --- a/Windows/GPU/D3D11Context.h +++ b/Windows/GPU/D3D11Context.h @@ -31,7 +31,6 @@ public: bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override {} void Resize() override; diff --git a/Windows/GPU/D3D9Context.h b/Windows/GPU/D3D9Context.h index b916ace945..8f1806bf44 100644 --- a/Windows/GPU/D3D9Context.h +++ b/Windows/GPU/D3D9Context.h @@ -35,7 +35,6 @@ public: bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override {} void Resize() override; diff --git a/Windows/GPU/WindowsGLContext.cpp b/Windows/GPU/WindowsGLContext.cpp index 42e65df116..7aa965967c 100644 --- a/Windows/GPU/WindowsGLContext.cpp +++ b/Windows/GPU/WindowsGLContext.cpp @@ -39,7 +39,7 @@ // Currently, just compile time for debugging. May be NVIDIA only. static const int simulateGLES = false; -void WindowsGLContext::SwapBuffers() { +void WindowsGLContext::Poll() { // We no longer call RenderManager::Swap here, it's handled by the render thread, which // we're not on here. diff --git a/Windows/GPU/WindowsGLContext.h b/Windows/GPU/WindowsGLContext.h index 2909be60f1..eac76176c3 100644 --- a/Windows/GPU/WindowsGLContext.h +++ b/Windows/GPU/WindowsGLContext.h @@ -18,7 +18,8 @@ public: void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override; + + void Poll() override; // Used during window resize. Must be called from the window thread, // not the rendering thread or CPU thread. diff --git a/Windows/GPU/WindowsGraphicsContext.h b/Windows/GPU/WindowsGraphicsContext.h index db022e9b5d..41efb96a2f 100644 --- a/Windows/GPU/WindowsGraphicsContext.h +++ b/Windows/GPU/WindowsGraphicsContext.h @@ -7,4 +7,3 @@ class WindowsGraphicsContext : public GraphicsContext { public: virtual bool Init(HINSTANCE hInst, HWND window, std::string *error_message) = 0; }; - diff --git a/Windows/GPU/WindowsVulkanContext.h b/Windows/GPU/WindowsVulkanContext.h index 49e6613e3e..c331ec1dbb 100644 --- a/Windows/GPU/WindowsVulkanContext.h +++ b/Windows/GPU/WindowsVulkanContext.h @@ -30,7 +30,6 @@ public: bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override {} - void SwapBuffers() override {} void Resize() override; void Poll() override; diff --git a/android/jni/AndroidJavaGLContext.h b/android/jni/AndroidJavaGLContext.h index 4b4ff95d14..d02ffcfac1 100644 --- a/android/jni/AndroidJavaGLContext.h +++ b/android/jni/AndroidJavaGLContext.h @@ -15,7 +15,6 @@ public: void ShutdownFromRenderThread() override; void Shutdown() override {} - void SwapBuffers() override {} void SwapInterval(int interval) override {} void Resize() override {} diff --git a/android/jni/AndroidVulkanContext.h b/android/jni/AndroidVulkanContext.h index f938643353..69d302bdea 100644 --- a/android/jni/AndroidVulkanContext.h +++ b/android/jni/AndroidVulkanContext.h @@ -16,7 +16,6 @@ public: void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override {} void Resize() override; void *GetAPIContext() override { return g_Vulkan; } diff --git a/headless/SDLHeadlessHost.cpp b/headless/SDLHeadlessHost.cpp index 7333e46460..c4cfbc616b 100644 --- a/headless/SDLHeadlessHost.cpp +++ b/headless/SDLHeadlessHost.cpp @@ -96,7 +96,6 @@ public: void Shutdown() override {} void Resize() override {} void SwapInterval(int interval) override {} - void SwapBuffers() override {} private: Draw::DrawContext *draw_ = nullptr; @@ -193,7 +192,6 @@ bool SDLHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext * if (!gfx_->ThreadFrame()) { break; } - gfx_->SwapBuffers(); } threadState_ = RenderThreadState::STOPPING; @@ -221,7 +219,6 @@ void SDLHeadlessHost::ShutdownGraphics() { } void SDLHeadlessHost::SwapBuffers() { - gfx_->SwapBuffers(); } #endif diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index 3aef27028a..a4da9eed64 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -132,7 +132,6 @@ bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsConte if (!gfx_->ThreadFrame()) { break; } - gfx_->SwapBuffers(); } threadState_ = RenderThreadState::STOPPING; @@ -173,5 +172,4 @@ void WindowsHeadlessHost::SwapBuffers() { TranslateMessage(&msg); DispatchMessage(&msg); } - gfx_->SwapBuffers(); } diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 97fd315037..89eff3a67b 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -64,7 +64,6 @@ public: } void SwapInterval(int interval) override {} - void SwapBuffers() override {} void Resize() override {} void Shutdown() override {} diff --git a/libretro/LibretroGraphicsContext.h b/libretro/LibretroGraphicsContext.h index ee15e5a1ac..dbb4f3b051 100644 --- a/libretro/LibretroGraphicsContext.h +++ b/libretro/LibretroGraphicsContext.h @@ -22,6 +22,7 @@ public: DestroyDrawContext(); } void SwapInterval(int interval) override {} + virtual void SwapBuffers() = 0; void Resize() override {} virtual void GotBackbuffer(); diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index fb29d8c77d..707418c62d 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -1174,7 +1174,7 @@ namespace Libretro if (ctx->GetDrawContext()) { ctx->GetDrawContext()->EndFrame(); - ctx->GetDrawContext()->Present(); + ctx->GetDrawContext()->Present(1); } }