radv: Add support for external queue family.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 22 May 2017 21:50:13 +0000 (23:50 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 5 Jun 2017 00:26:43 +0000 (02:26 +0200)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index 9a76d2852429476e469f79adbe3fc042519d4eab..22bc6b41da86e3b30f676a227de1e115b0839436 100644 (file)
@@ -644,7 +644,10 @@ radv_image_create(VkDevice _device,
        image->exclusive = pCreateInfo->sharingMode == VK_SHARING_MODE_EXCLUSIVE;
        if (pCreateInfo->sharingMode == VK_SHARING_MODE_CONCURRENT) {
                for (uint32_t i = 0; i < pCreateInfo->queueFamilyIndexCount; ++i)
-                       image->queue_family_mask |= 1u << pCreateInfo->pQueueFamilyIndices[i];
+                       if (pCreateInfo->pQueueFamilyIndices[i] == VK_QUEUE_FAMILY_EXTERNAL_KHX)
+                               image->queue_family_mask |= (1u << RADV_MAX_QUEUE_FAMILIES) - 1u;
+                       else
+                               image->queue_family_mask |= 1u << pCreateInfo->pQueueFamilyIndices[i];
        }
 
        radv_init_surface(device, &image->surface, create_info);
@@ -803,6 +806,8 @@ unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t f
 {
        if (!image->exclusive)
                return image->queue_family_mask;
+       if (family == VK_QUEUE_FAMILY_EXTERNAL_KHX)
+               return (1u << RADV_MAX_QUEUE_FAMILIES) - 1u;
        if (family == VK_QUEUE_FAMILY_IGNORED)
                return 1u << queue_family;
        return 1u << family;