From a6aab5dfd6d94be4e2a07c2bf6044f621b28e631 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 1 Oct 2017 01:42:06 +0200 Subject: vo_gpu: vulkan: refine queue family selection algorithm This gets confused by e.g. SPARSE_BIT on the TRANSFER_BIT, leading to situations where "more specialized" is ambiguous and the logic breaks down. So to fix it, only compare the subset we care about. --- video/out/vulkan/utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'video/out') diff --git a/video/out/vulkan/utils.c b/video/out/vulkan/utils.c index cb73e7d8ac..3dfb825032 100644 --- a/video/out/vulkan/utils.c +++ b/video/out/vulkan/utils.c @@ -395,8 +395,13 @@ static int find_qf(VkQueueFamilyProperties *qfs, int qfnum, VkQueueFlags flags) if (!(qfs[i].queueFlags & flags)) continue; - // QF is more specialized - if (idx < 0 || qfs[i].queueFlags < qfs[idx].queueFlags) + // QF is more specialized. Since we don't care about other bits like + // SPARSE_BIT, mask the ones we're interestew in + const VkQueueFlags mask = VK_QUEUE_GRAPHICS_BIT | + VK_QUEUE_TRANSFER_BIT | + VK_QUEUE_COMPUTE_BIT; + + if (idx < 0 || (qfs[i].queueFlags & mask) < (qfs[idx].queueFlags & mask)) idx = i; // QF has more queues (at the same specialization level) -- cgit v1.2.3