diff options
author | Niklas Haas <git@haasn.xyz> | 2018-11-10 20:11:48 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-11-19 00:22:41 +0200 |
commit | 34df6bd82fe4a32b1a4b1d878297976a999aabe4 (patch) | |
tree | d100c882bf0ca616d76eeb8c15851506e4f0e1e9 /video/out/vulkan | |
parent | 95589fd4f84c60fe4441dcb9d9b3462eb6b1643f (diff) | |
download | mpv-34df6bd82fe4a32b1a4b1d878297976a999aabe4.tar.bz2 mpv-34df6bd82fe4a32b1a4b1d878297976a999aabe4.tar.xz |
vo_gpu: vulkan: only rotate the queues on swap
Makes performance slightly better when using multiple queues by avoiding
unnecessary semaphores due to bad queue selection.
Also remove an aeons-old workaround for an nvidia bug that only ever
existed in the earliest beta vulkan drivers anyway.
Diffstat (limited to 'video/out/vulkan')
-rw-r--r-- | video/out/vulkan/context.c | 15 | ||||
-rw-r--r-- | video/out/vulkan/utils.c | 6 |
2 files changed, 9 insertions, 12 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index 6a029e10f8..b819345d74 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -521,12 +521,15 @@ static bool submit_frame(struct ra_swapchain *sw, const struct vo_frame *frame) if (!mpvk_flush_commands(vk)) return false; - // Older nvidia drivers can spontaneously combust when submitting to the - // same queue as we're rendering from, in a multi-queue scenario. Safest - // option is to flush the commands first and then submit to the next queue. - // We can drop this hack in the future, I suppose. - struct vk_cmdpool *pool = vk->pool_graphics; - VkQueue queue = pool->queues[pool->idx_queues]; + // Submit to the same queue that we were currently rendering to + struct vk_cmdpool *pool_gfx = vk->pool_graphics; + VkQueue queue = pool_gfx->queues[pool_gfx->idx_queues]; + + // Rotate the queues to ensure good parallelism across frames + for (int i = 0; i < vk->num_pools; i++) { + struct vk_cmdpool *pool = vk->pools[i]; + pool->idx_queues = (pool->idx_queues + 1) % pool->num_queues; + } VkPresentInfoKHR pinfo = { .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c index e4bf58f514..62ac3e87f9 100644 --- a/video/out/vulkan/utils.c +++ b/video/out/vulkan/utils.c @@ -796,12 +796,6 @@ error: vk->num_cmds_queued = 0; - // Rotate the queues to ensure good parallelism across frames - for (int i = 0; i < vk->num_pools; i++) { - struct vk_cmdpool *pool = vk->pools[i]; - pool->idx_queues = (pool->idx_queues + 1) % pool->num_queues; - } - return ret; } |