From 1d375cb13cf9473d0c9da0f12b038e50507cbffc Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 9 Oct 2017 19:34:54 +0300 Subject: [PATCH] vulkan: Fix window resize race condition when doing flip --- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index 651fe2cbf3..b65aba730a 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -2293,10 +2293,13 @@ void VKGSRender::flip(int buffer) bool resize_screen = false; - if (m_client_height != m_frame->client_height() || - m_client_width != m_frame->client_width()) + const auto frame_width = m_frame->client_width(); + const auto frame_height = m_frame->client_height(); + + if (m_client_height != frame_height || + m_client_width != frame_width) { - if (!!m_frame->client_height() && !!m_frame->client_width()) + if (!!frame_width && !!frame_height) resize_screen = true; } @@ -2340,7 +2343,7 @@ void VKGSRender::flip(int buffer) coordi aspect_ratio; - sizei csize = { m_frame->client_width(), m_frame->client_height() }; + sizei csize = { frame_width, frame_height }; sizei new_size = csize; if (!g_cfg.video.stretch_to_display_area)