Remove "SwapBuffers" from the GraphicsContext interface.

Buildfixes

More buildfix

headless buildfix

One more buildfix
This commit is contained in:
Henrik Rydgård 2023-08-11 00:58:24 +02:00
parent ed9b033f7d
commit 1ea11c233c
20 changed files with 5 additions and 33 deletions

View File

@ -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() {}

View File

@ -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() {

View File

@ -70,7 +70,6 @@ public:
// See TODO in constructor.
// renderManager_->SwapInterval(interval);
}
void SwapBuffers() override {}
void Resize() override {}
Draw::DrawContext *GetDrawContext() override {

View File

@ -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;

View File

@ -1452,8 +1452,6 @@ int main(int argc, char *argv[]) {
break;
}
graphicsContext->SwapBuffers();
{
std::lock_guard<std::mutex> guard(g_mutexWindow);
if (g_windowState.update) {

View File

@ -26,10 +26,6 @@ public:
void Shutdown() override;
void SwapBuffers() override {
// We don't do it this way.
}
void Resize() override;
void Poll() override;

View File

@ -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_;

View File

@ -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;

View File

@ -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;

View File

@ -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.

View File

@ -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.

View File

@ -7,4 +7,3 @@ class WindowsGraphicsContext : public GraphicsContext {
public:
virtual bool Init(HINSTANCE hInst, HWND window, std::string *error_message) = 0;
};

View File

@ -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;

View File

@ -15,7 +15,6 @@ public:
void ShutdownFromRenderThread() override;
void Shutdown() override {}
void SwapBuffers() override {}
void SwapInterval(int interval) override {}
void Resize() override {}

View File

@ -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; }

View File

@ -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

View File

@ -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();
}

View File

@ -64,7 +64,6 @@ public:
}
void SwapInterval(int interval) override {}
void SwapBuffers() override {}
void Resize() override {}
void Shutdown() override {}

View File

@ -22,6 +22,7 @@ public:
DestroyDrawContext();
}
void SwapInterval(int interval) override {}
virtual void SwapBuffers() = 0;
void Resize() override {}
virtual void GotBackbuffer();

View File

@ -1174,7 +1174,7 @@ namespace Libretro
if (ctx->GetDrawContext()) {
ctx->GetDrawContext()->EndFrame();
ctx->GetDrawContext()->Present();
ctx->GetDrawContext()->Present(1);
}
}