Commit 644f9d57 authored by Niklas Haas's avatar Niklas Haas

vulkan: change infinite loop polls to block indefinitely

I forgot what the original justification was for using short timeouts
here (perhaps some driver bug?) but in any case, it doesn't seem to make
any sense anymore.

This reduces CPU usage drastically on some drivers. I kept one loop at
10 ms since it shouldn't be hit anyways, and this way we know it's stuck
in that loop for absurd amounts of time.
parent 0fdb645d
Pipeline #7200 passed with stages
in 1 minute and 36 seconds
......@@ -433,7 +433,7 @@ error:
// Wait until we've processed some of the now pending commands
while (vk->num_cmds_pending > PL_VK_MAX_PENDING_CMDS)
vk_poll_commands(vk, 1000000000); // 1s
vk_poll_commands(vk, UINT64_MAX);
return ret;
}
......
......@@ -2527,7 +2527,7 @@ static void vk_pass_run(const struct pl_gpu *gpu,
while (!pass_vk->dmask) {
PL_TRACE(gpu, "No free descriptor sets! ...blocking (slow path)");
vk_submit(gpu);
vk_poll_commands(vk, 1000000); // 1ms
vk_poll_commands(vk, 10000000); // 10 ms
}
}
......
......@@ -460,7 +460,7 @@ static bool vk_sw_recreate(const struct pl_swapchain *sw, int w, int h)
// than one swapchain already active, so we need to flush any pending
// asynchronous swapchain release operations that may be ongoing
while (p->old_swapchain)
vk_poll_commands(vk, 1000000); // 1 ms
vk_poll_commands(vk, UINT64_MAX);
VkSwapchainCreateInfoKHR sinfo = p->protoInfo;
sinfo.oldSwapchain = p->swapchain;
......@@ -664,7 +664,7 @@ static void vk_sw_swap_buffers(const struct pl_swapchain *sw)
struct priv *p = sw->priv;
while (p->frames_in_flight >= p->swapchain_depth)
vk_poll_commands(p->vk, 1000000); // 1 ms
vk_poll_commands(p->vk, UINT64_MAX);
}
static bool vk_sw_resize(const struct pl_swapchain *sw, int *width, int *height)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment