diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index e92df4ffa3..c7fd087fe9 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -2349,11 +2349,12 @@ void VKGSRender::queue_swap_request() VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT); } + // Signal pending state as the command queue is now closed + m_current_frame->swap_command_buffer->pending = true; + // Set up a present request for this frame as well present(m_current_frame); - m_current_frame->swap_command_buffer->pending = true; - // Grab next cb in line and make it usable m_current_cb_index = (m_current_cb_index + 1) % VK_MAX_ASYNC_CB_COUNT; m_current_command_buffer = &m_primary_cb_list[m_current_cb_index]; diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.h b/rpcs3/Emu/RSX/VK/VKGSRender.h index 4612071357..8f981a83a5 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.h +++ b/rpcs3/Emu/RSX/VK/VKGSRender.h @@ -156,8 +156,13 @@ struct command_buffer_chunk: public vk::command_buffer return ret; } - void flush() const + void flush() { + reader_lock lock(guard_mutex); + + if (!pending) + return; + submit_fence->wait_flush(); } };