From 93032be4aba36518ae501ca30171d1cdd0d82f18 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Thu, 10 Mar 2016 20:45:57 +0300 Subject: [PATCH] Move waiting for submit fence to the right place (nvidia crash) --- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index ac557a5ebb..cf62146cb5 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -993,17 +993,6 @@ void VKGSRender::flip(int buffer) aspect_ratio.size = m_frame->client_size(); } - //Check if anything is waiting in queue and submit it if possible.. - if (m_submit_fence) - { - CHECK_RESULT(vkWaitForFences((*m_device), 1, &m_submit_fence, VK_TRUE, ~0ULL)); - - vkDestroyFence((*m_device), m_submit_fence, nullptr); - m_submit_fence = nullptr; - - CHECK_RESULT(vkResetCommandBuffer(m_command_buffer, 0)); - } - VkSwapchainKHR swap_chain = (VkSwapchainKHR)(*m_swap_chain); uint32_t next_image_temp = 0; @@ -1051,6 +1040,17 @@ void VKGSRender::flip(int buffer) end_command_buffer_recording(); execute_command_buffer(false); + //Check if anything is waiting in queue and wait for it if possible.. + if (m_submit_fence) + { + CHECK_RESULT(vkWaitForFences((*m_device), 1, &m_submit_fence, VK_TRUE, ~0ULL)); + + vkDestroyFence((*m_device), m_submit_fence, nullptr); + m_submit_fence = nullptr; + + CHECK_RESULT(vkResetCommandBuffer(m_command_buffer, 0)); + } + CHECK_RESULT(m_swap_chain->queuePresentKHR(m_swap_chain->get_present_queue(), &present)); CHECK_RESULT(vkQueueWaitIdle(m_swap_chain->get_present_queue()));