vk: Fix cb chunk synchronization deadlock
This commit is contained in:
@@ -2349,11 +2349,12 @@ void VKGSRender::queue_swap_request()
|
|||||||
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT);
|
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
|
// Set up a present request for this frame as well
|
||||||
present(m_current_frame);
|
present(m_current_frame);
|
||||||
|
|
||||||
m_current_frame->swap_command_buffer->pending = true;
|
|
||||||
|
|
||||||
// Grab next cb in line and make it usable
|
// 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_cb_index = (m_current_cb_index + 1) % VK_MAX_ASYNC_CB_COUNT;
|
||||||
m_current_command_buffer = &m_primary_cb_list[m_current_cb_index];
|
m_current_command_buffer = &m_primary_cb_list[m_current_cb_index];
|
||||||
|
|||||||
@@ -156,8 +156,13 @@ struct command_buffer_chunk: public vk::command_buffer
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush() const
|
void flush()
|
||||||
{
|
{
|
||||||
|
reader_lock lock(guard_mutex);
|
||||||
|
|
||||||
|
if (!pending)
|
||||||
|
return;
|
||||||
|
|
||||||
submit_fence->wait_flush();
|
submit_fence->wait_flush();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user