Tweaked Vulkan transfer queue family selection (#669)
Update wiGraphicsDevice_Vulkan.cpp Changed Vulkan transfer queue family search to more to first look for a fully exclusive transfer queue family, even without video and optical flow caps. If that fails, it will fall back to the previous behavior. This change works around driver issues in some scenarios.
This commit is contained in:
@@ -2636,18 +2636,14 @@ using namespace vulkan_internal;
|
||||
familyIndex = 0;
|
||||
for (const auto& queueFamily : queueFamilies)
|
||||
{
|
||||
if (queueFamily.queueCount > 0 &&
|
||||
queueFamily.queueFlags & VK_QUEUE_TRANSFER_BIT &&
|
||||
!(queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) &&
|
||||
!(queueFamily.queueFlags & VK_QUEUE_COMPUTE_BIT)
|
||||
)
|
||||
if (queueFamily.queueCount > 0 && (queueFamily.queueFlags == VK_QUEUE_TRANSFER_BIT))
|
||||
{
|
||||
copyFamily = familyIndex;
|
||||
|
||||
if (queueFamily.queueFlags & VK_QUEUE_SPARSE_BINDING_BIT)
|
||||
{
|
||||
queues[QUEUE_COPY].sparse_binding_supported = true;
|
||||
}
|
||||
}
|
||||
else if (queueFamily.queueCount > 0 && queueFamily.queueFlags == (VK_QUEUE_TRANSFER_BIT | VK_QUEUE_SPARSE_BINDING_BIT))
|
||||
{
|
||||
copyFamily = familyIndex;
|
||||
queues[QUEUE_COPY].sparse_binding_supported = true;
|
||||
}
|
||||
|
||||
if (queueFamily.queueCount > 0 &&
|
||||
@@ -2666,6 +2662,29 @@ using namespace vulkan_internal;
|
||||
familyIndex++;
|
||||
}
|
||||
|
||||
// If the above search found no transfer family, fall back to the less strict exclusivity criteria
|
||||
if (copyFamily == VK_QUEUE_FAMILY_IGNORED)
|
||||
{
|
||||
familyIndex = 0;
|
||||
for (const auto& queueFamily : queueFamilies)
|
||||
{
|
||||
if (queueFamily.queueCount > 0 &&
|
||||
queueFamily.queueFlags & VK_QUEUE_TRANSFER_BIT &&
|
||||
!(queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) &&
|
||||
!(queueFamily.queueFlags & VK_QUEUE_COMPUTE_BIT)
|
||||
)
|
||||
{
|
||||
copyFamily = familyIndex;
|
||||
|
||||
if (queueFamily.queueFlags & VK_QUEUE_SPARSE_BINDING_BIT)
|
||||
{
|
||||
queues[QUEUE_COPY].sparse_binding_supported = true;
|
||||
}
|
||||
}
|
||||
familyIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
wi::vector<VkDeviceQueueCreateInfo> queueCreateInfos;
|
||||
wi::unordered_set<uint32_t> uniqueQueueFamilies = { graphicsFamily,copyFamily,computeFamily };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user