|
|
@ -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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::unique_lock lock{queue_mutex};
|
|
|
|
scheduler.Record([this, frame](vk::CommandBuffer) {
|
|
|
|
present_queue.push(frame);
|
|
|
|
std::unique_lock lock{queue_mutex};
|
|
|
|
frame_cv.notify_one();
|
|
|
|
present_queue.push(frame);
|
|
|
|
|
|
|
|
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,
|
|
|
|