summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/Render.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-08-13 22:08:53 +1000
committerStenzek <stenzek@gmail.com>2016-10-01 01:09:12 +1000
commit6a99cbd9fc32637b18b1b030ec06ce9c73be04eb (patch)
treeb52a33a7563cd99c00a0fdbb9d3048c7452897ce /Source/Core/VideoBackends/OGL/Render.cpp
parent534607879199e700dbd143317e71218140a58b56 (diff)
VideoCommon: Call Renderer::SurfaceChanged on render parent resize
This is needed because for some reason the WSI for NV Vulkan drivers doesn't return VK_ERROR_OUT_OF_DATE_KHR, so there is no other way to know that a resize has occured apart from polling, which is a poor solution for X11 (since it is blocking).
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/Render.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp
index 3fb9ebb755..c1e8165b9b 100644
--- a/Source/Core/VideoBackends/OGL/Render.cpp
+++ b/Source/Core/VideoBackends/OGL/Render.cpp
@@ -1620,12 +1620,16 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight,
OSD::DoCallbacks(OSD::CallbackType::OnFrame);
OSD::DrawMessages();
- if (s_SurfaceNeedsChanged.IsSet())
+#ifdef ANDROID
+ if (s_surface_needs_change.IsSet())
{
+ GLInterface->UpdateHandle(s_new_surface_handle);
GLInterface->UpdateSurface();
- s_SurfaceNeedsChanged.Clear();
- s_ChangedSurface.Set();
+ s_new_surface_handle = nullptr;
+ s_surface_needs_change.Clear();
+ s_surface_changed.Set();
}
+#endif
// Copy the rendered frame to the real window
GLInterface->Swap();
@@ -1814,4 +1818,16 @@ int Renderer::GetMaxTextureSize()
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &s_max_texture_size);
return s_max_texture_size;
}
+
+void Renderer::ChangeSurface(void* new_surface_handle)
+{
+// Win32 polls the window size when redrawing, X11 runs an event loop in another thread.
+// This is only necessary for Android at this point, although handling resizes here
+// would be more efficient than polling.
+#ifdef ANDROID
+ s_new_surface_handle = new_surface_handle;
+ s_surface_needs_change.Set();
+ s_surface_changed.Wait();
+#endif
+}
}