radv: Support VK_EXT_queue_family_foreign.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 3 Jul 2019 00:25:19 +0000 (02:25 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 3 Jul 2019 10:56:21 +0000 (10:56 +0000)
Basically same as external for now.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Only case we might need to handle differently in the near future
is Raven's case of displayable DCC which is not renderable. But
we don't support that yet.

docs/relnotes/19.2.0.html
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_extensions.py
src/amd/vulkan/radv_image.c

index 0809d9489ba5333fbc585c28235b68ccfcf694b1..907edf447f038c08f8bdd83c271a42683cb937a5 100644 (file)
@@ -40,6 +40,7 @@ TBD.
 
 <ul>
 <li>EGL_EXT_platform_device</li>
+<li>VK_EXT_queue_family_foreign for radv</li>
 </ul>
 
 <h2>Bug fixes</h2>
index ed5822a37c6bd3ce15fd64a5c59fb948a732eea5..f1e0ce2323320685131384d3b792b8cad70c51d9 100644 (file)
@@ -5111,7 +5111,8 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
                assert(src_family == cmd_buffer->queue_family_index ||
                       dst_family == cmd_buffer->queue_family_index);
 
-               if (src_family == VK_QUEUE_FAMILY_EXTERNAL)
+               if (src_family == VK_QUEUE_FAMILY_EXTERNAL ||
+                   src_family == VK_QUEUE_FAMILY_FOREIGN_EXT)
                        return;
 
                if (cmd_buffer->queue_family_index == RADV_QUEUE_TRANSFER)
index 90c3a57db4934b91cb8ece5d6b5fd2cff5402b6b..acb408760f9f4da9a6910af54df063c639b6aa85 100644 (file)
@@ -120,6 +120,7 @@ EXTENSIONS = [
     Extension('VK_EXT_memory_priority',                   1, True),
     Extension('VK_EXT_pci_bus_info',                      2, True),
     Extension('VK_EXT_pipeline_creation_feedback',        1, True),
+    Extension('VK_EXT_queue_family_foreign',              1, True),
     Extension('VK_EXT_sample_locations',                  1, True),
     Extension('VK_EXT_sampler_filter_minmax',             1, 'device->rad_info.chip_class >= GFX7'),
     Extension('VK_EXT_scalar_block_layout',               1, 'device->rad_info.chip_class >= GFX7'),
index dc598d9eecf692480de22abc26873f92aea299f8..e92aef3ba30f0ffb53a46254575d8680b53e7148 100644 (file)
@@ -1125,7 +1125,8 @@ 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)
-                       if (pCreateInfo->pQueueFamilyIndices[i] == VK_QUEUE_FAMILY_EXTERNAL)
+                       if (pCreateInfo->pQueueFamilyIndices[i] == VK_QUEUE_FAMILY_EXTERNAL ||
+                           pCreateInfo->pQueueFamilyIndices[i] == VK_QUEUE_FAMILY_FOREIGN_EXT)
                                image->queue_family_mask |= (1u << RADV_MAX_QUEUE_FAMILIES) - 1u;
                        else
                                image->queue_family_mask |= 1u << pCreateInfo->pQueueFamilyIndices[i];
@@ -1471,7 +1472,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)
+       if (family == VK_QUEUE_FAMILY_EXTERNAL ||
+           family == VK_QUEUE_FAMILY_FOREIGN_EXT)
                return (1u << RADV_MAX_QUEUE_FAMILIES) - 1u;
        if (family == VK_QUEUE_FAMILY_IGNORED)
                return 1u << queue_family;