mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
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).
This commit is contained in:
@ -747,35 +747,21 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChang
|
||||
if (surf == nullptr)
|
||||
__android_log_print(ANDROID_LOG_ERROR, DOLPHIN_TAG, "Error: Surface is null.");
|
||||
|
||||
// If GLInterface isn't a thing yet then we don't need to let it know that the
|
||||
// surface has changed
|
||||
if (GLInterface)
|
||||
{
|
||||
GLInterface->UpdateHandle(surf);
|
||||
Renderer::s_ChangedSurface.Reset();
|
||||
Renderer::s_SurfaceNeedsChanged.Set();
|
||||
Renderer::s_ChangedSurface.Wait();
|
||||
}
|
||||
if (g_renderer)
|
||||
g_renderer->ChangeSurface(surf);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
if (g_renderer)
|
||||
g_renderer->ChangeSurface(nullptr);
|
||||
|
||||
if (surf)
|
||||
{
|
||||
ANativeWindow_release(surf);
|
||||
surf = nullptr;
|
||||
}
|
||||
|
||||
// If GLInterface isn't a thing yet then we don't need to let it know that the
|
||||
// surface has changed
|
||||
if (GLInterface)
|
||||
{
|
||||
GLInterface->UpdateHandle(nullptr);
|
||||
Renderer::s_ChangedSurface.Reset();
|
||||
Renderer::s_SurfaceNeedsChanged.Set();
|
||||
Renderer::s_ChangedSurface.Wait();
|
||||
}
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv* env,
|
||||
jobject obj)
|
||||
|
Reference in New Issue
Block a user