diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index 60c037e005..6447f6948b 100644 --- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -209,9 +209,6 @@ class PlatformX11 : public Platform void MainLoop() override { bool fullscreen = SConfig::GetInstance().bFullscreen; - int last_window_width = SConfig::GetInstance().iRenderWindowWidth; - int last_window_height = SConfig::GetInstance().iRenderWindowHeight; - if (fullscreen) { rendererIsFullscreen = X11Utils::ToggleFullscreen(dpy, win); @@ -311,14 +308,8 @@ class PlatformX11 : public Platform break; case ConfigureNotify: { - if (last_window_width != event.xconfigure.width || - last_window_height != event.xconfigure.height) - { - last_window_width = event.xconfigure.width; - last_window_height = event.xconfigure.height; - if (g_renderer) - g_renderer->ResizeSurface(last_window_width, last_window_height); - } + if (g_renderer) + g_renderer->ResizeSurface(); } break; } diff --git a/Source/Core/DolphinQt/Host.cpp b/Source/Core/DolphinQt/Host.cpp index 0470c008b5..daaaee14b0 100644 --- a/Source/Core/DolphinQt/Host.cpp +++ b/Source/Core/DolphinQt/Host.cpp @@ -68,7 +68,7 @@ void Host::SetRenderFullscreen(bool fullscreen) void Host::ResizeSurface(int new_width, int new_height) { if (g_renderer) - g_renderer->ResizeSurface(new_width, new_height); + g_renderer->ResizeSurface(); } void Host_Message(HostMessageID id) diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index fc413673da..bfaa5763ba 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -719,9 +719,6 @@ void Renderer::CheckForSurfaceResize() if (!m_surface_resized.TestAndClear() && !exclusive_fullscreen_changed) return; - m_backbuffer_width = m_new_backbuffer_width; - m_backbuffer_height = m_new_backbuffer_height; - SAFE_RELEASE(m_screenshot_texture); SAFE_RELEASE(m_3d_vision_texture); m_last_fullscreen_state = fullscreen_state; diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 5ee01701f2..be08541f97 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1518,8 +1518,8 @@ void Renderer::CheckForSurfaceResize() return; g_main_gl_context->Update(); - m_backbuffer_width = m_new_backbuffer_width; - m_backbuffer_height = m_new_backbuffer_height; + m_backbuffer_width = g_main_gl_context->GetBackBufferWidth(); + m_backbuffer_height = g_main_gl_context->GetBackBufferHeight(); } void Renderer::DrawEFB(GLuint framebuffer, const TargetRectangle& target_rc, diff --git a/Source/Core/VideoBackends/Vulkan/Renderer.cpp b/Source/Core/VideoBackends/Vulkan/Renderer.cpp index 371b9033a8..ce52b0718d 100644 --- a/Source/Core/VideoBackends/Vulkan/Renderer.cpp +++ b/Source/Core/VideoBackends/Vulkan/Renderer.cpp @@ -889,9 +889,6 @@ void Renderer::CheckForSurfaceResize() if (!m_surface_resized.TestAndClear()) return; - m_backbuffer_width = m_new_backbuffer_width; - m_backbuffer_height = m_new_backbuffer_height; - // If we don't have a surface, how can we resize the swap chain? // CheckForSurfaceChange should handle this case. if (!m_swap_chain) diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 3c7eec10f1..5aa6989615 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -417,11 +417,9 @@ void Renderer::ChangeSurface(void* new_surface_handle) m_surface_changed.Set(); } -void Renderer::ResizeSurface(int new_width, int new_height) +void Renderer::ResizeSurface() { std::lock_guard lock(m_swap_mutex); - m_new_backbuffer_width = new_width; - m_new_backbuffer_height = new_height; m_surface_resized.Set(); } diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 07f7ea7bae..d5dd761c40 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -183,7 +183,7 @@ public: // Final surface changing // This is called when the surface is resized (WX) or the window changes (Android). void ChangeSurface(void* new_surface_handle); - void ResizeSurface(int new_width, int new_height); + void ResizeSurface(); bool UseVertexDepthRange() const; virtual std::unique_ptr CreateAsyncShaderCompiler(); @@ -229,8 +229,6 @@ protected: // Backbuffer (window) size and render area int m_backbuffer_width = 0; int m_backbuffer_height = 0; - int m_new_backbuffer_width = 0; - int m_new_backbuffer_height = 0; TargetRectangle m_target_rectangle = {}; FPSCounter m_fps_counter;