mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-03 03:49:59 +00:00
vk_present_manager: Fix softlocks when disabling async present
This commit is contained in:
parent
8f43b05d6b
commit
f3fcc15ad5
3 changed files with 9 additions and 6 deletions
|
@ -134,7 +134,7 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
|
||||||
Frame* frame = present_manager.GetRenderFrame();
|
Frame* frame = present_manager.GetRenderFrame();
|
||||||
blit_screen.DrawToSwapchain(frame, *framebuffer, use_accelerated, is_srgb);
|
blit_screen.DrawToSwapchain(frame, *framebuffer, use_accelerated, is_srgb);
|
||||||
scheduler.Flush(*frame->render_ready);
|
scheduler.Flush(*frame->render_ready);
|
||||||
scheduler.Record([this, frame](vk::CommandBuffer) { present_manager.PushFrame(frame); });
|
present_manager.Present(frame);
|
||||||
|
|
||||||
gpu.RendererFrameEndNotify();
|
gpu.RendererFrameEndNotify();
|
||||||
rasterizer.TickFrame();
|
rasterizer.TickFrame();
|
||||||
|
|
|
@ -153,16 +153,19 @@ Frame* PresentManager::GetRenderFrame() {
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresentManager::PushFrame(Frame* frame) {
|
void PresentManager::Present(Frame* frame) {
|
||||||
if (!use_present_thread) {
|
if (!use_present_thread) {
|
||||||
|
scheduler.WaitWorker();
|
||||||
CopyToSwapchain(frame);
|
CopyToSwapchain(frame);
|
||||||
free_queue.push(frame);
|
free_queue.push(frame);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scheduler.Record([this, frame](vk::CommandBuffer) {
|
||||||
std::unique_lock lock{queue_mutex};
|
std::unique_lock lock{queue_mutex};
|
||||||
present_queue.push(frame);
|
present_queue.push(frame);
|
||||||
frame_cv.notify_one();
|
frame_cv.notify_one();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, bool is_srgb,
|
void PresentManager::RecreateFrame(Frame* frame, u32 width, u32 height, bool is_srgb,
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
Frame* GetRenderFrame();
|
Frame* GetRenderFrame();
|
||||||
|
|
||||||
/// Pushes a frame for presentation
|
/// Pushes a frame for presentation
|
||||||
void PushFrame(Frame* frame);
|
void Present(Frame* frame);
|
||||||
|
|
||||||
/// Recreates the present frame to match the provided parameters
|
/// Recreates the present frame to match the provided parameters
|
||||||
void RecreateFrame(Frame* frame, u32 width, u32 height, bool is_srgb,
|
void RecreateFrame(Frame* frame, u32 width, u32 height, bool is_srgb,
|
||||||
|
|
Loading…
Reference in a new issue