Revert "Revert "vk_scheduler: wait for command processing to complete""
* No longer needed after async present and causes sync issues during swapchain recreation
This reverts commit 0381081c5d
.
This commit is contained in:
@ -562,13 +562,6 @@ bool RasterizerVulkan::Draw(bool accelerate, bool is_indexed) {
|
|||||||
// Mark framebuffer surfaces as dirty
|
// Mark framebuffer surfaces as dirty
|
||||||
res_cache.InvalidateRenderTargets(framebuffer);
|
res_cache.InvalidateRenderTargets(framebuffer);
|
||||||
|
|
||||||
static int counter = 20;
|
|
||||||
counter--;
|
|
||||||
if (counter == 0) {
|
|
||||||
scheduler.DispatchWork();
|
|
||||||
counter = 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
return succeeded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ void Scheduler::WorkerThread(std::stop_token stop_token) {
|
|||||||
Common::SetCurrentThreadName("VulkanWorker");
|
Common::SetCurrentThreadName("VulkanWorker");
|
||||||
do {
|
do {
|
||||||
std::unique_ptr<CommandChunk> work;
|
std::unique_ptr<CommandChunk> work;
|
||||||
|
bool has_submit{false};
|
||||||
{
|
{
|
||||||
std::unique_lock lock{work_mutex};
|
std::unique_lock lock{work_mutex};
|
||||||
if (work_queue.empty()) {
|
if (work_queue.empty()) {
|
||||||
@ -94,9 +95,10 @@ void Scheduler::WorkerThread(std::stop_token stop_token) {
|
|||||||
}
|
}
|
||||||
work = std::move(work_queue.front());
|
work = std::move(work_queue.front());
|
||||||
work_queue.pop();
|
work_queue.pop();
|
||||||
|
|
||||||
|
has_submit = work->HasSubmit();
|
||||||
|
work->ExecuteAll(current_cmdbuf);
|
||||||
}
|
}
|
||||||
const bool has_submit = work->HasSubmit();
|
|
||||||
work->ExecuteAll(current_cmdbuf);
|
|
||||||
if (has_submit) {
|
if (has_submit) {
|
||||||
AllocateWorkerCommandBuffers();
|
AllocateWorkerCommandBuffers();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user