<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 14, 2017 at 5:08 PM, Bas Nieuwenhuizen <span dir="ltr"><<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Bas Nieuwenhuizen <<a href="mailto:basni@google.com">basni@google.com</a>><br>
---<br>
 src/amd/vulkan/radv_device.c           | 36 ++++++++++++++++++++++++++++++<wbr>++--<br>
 src/amd/vulkan/radv_<wbr>entrypoints_gen.py |  1 +<br>
 2 files changed, 35 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c<br>
index c5d66b8bc6d..59c4ea8448e 100644<br>
--- a/src/amd/vulkan/radv_device.c<br>
+++ b/src/amd/vulkan/radv_device.c<br>
@@ -141,6 +141,10 @@ static const VkExtensionProperties common_device_extensions[] = {<br>
                .extensionName = VK_KHR_GET_MEMORY_<wbr>REQUIREMENTS_2_EXTENSION_NAME,<br>
                .specVersion = 1,<br>
        },<br>
+       {<br>
+               .extensionName = VK_KHR_DEDICATED_ALLOCATION_<wbr>EXTENSION_NAME,<br>
+               .specVersion = 1,<br>
+       },<br>
 };<br>
<br>
 static VkResult<br>
@@ -2072,8 +2076,8 @@ VkResult radv_AllocateMemory(<br>
                *pMem = VK_NULL_HANDLE;<br>
                return VK_SUCCESS;<br>
        }<br>
-       const VkDedicatedAllocationMemoryAll<wbr>ocateInfoNV *dedicate_info =<br>
-               vk_find_struct_const(<wbr>pAllocateInfo->pNext, DEDICATED_ALLOCATION_MEMORY_<wbr>ALLOCATE_INFO_NV);<br>
+       const VkMemoryDedicatedAllocateInfoK<wbr>HR *dedicate_info =<br>
+               vk_find_struct_const(<wbr>pAllocateInfo->pNext, MEMORY_DEDICATED_ALLOCATE_<wbr>INFO_KHR);<br>
<br>
        mem = vk_alloc2(&device->alloc, pAllocator, sizeof(*mem), 8,<br>
                          VK_SYSTEM_ALLOCATION_SCOPE_<wbr>OBJECT);<br>
@@ -2217,6 +2221,20 @@ void radv_<wbr>GetBufferMemoryRequirements2KH<wbr>R(<br>
 {<br>
        radv_<wbr>GetBufferMemoryRequirements(<wbr>device, pInfo->buffer,<br>
                                         &pMemoryRequirements-><wbr>memoryRequirements);<br>
+<br>
+       vk_foreach_struct(ext, pMemoryRequirements->pNext) {<br>
+               switch (ext->sType) {<br>
+               case VK_STRUCTURE_TYPE_MEMORY_<wbr>DEDICATED_REQUIREMENTS_KHR: {<br>
+                       VkMemoryDedicatedRequirementsK<wbr>HR *req =<br>
+                                      (<wbr>VkMemoryDedicatedRequirementsK<wbr>HR *) ext;<br>
+                       req-><wbr>requiresDedicatedAllocation = false;<br>
+                       req-><wbr>prefersDedicatedAllocation = req-><wbr>requiresDedicatedAllocation;<br>
+                       break;<br>
+               }<br>
+               default:<br>
+                       break;<br>
+               }<br>
+       }<br>
 }<br>
<br>
 void radv_<wbr>GetImageMemoryRequirements(<br>
@@ -2239,6 +2257,20 @@ void radv_<wbr>GetImageMemoryRequirements2KHR<wbr>(<br>
 {<br>
        radv_<wbr>GetImageMemoryRequirements(<wbr>device, pInfo->image,<br>
                                         &pMemoryRequirements-><wbr>memoryRequirements);<br>
+<br>
+       vk_foreach_struct(ext, pMemoryRequirements->pNext) {<br>
+               switch (ext->sType) {<br>
+               case VK_STRUCTURE_TYPE_MEMORY_<wbr>DEDICATED_REQUIREMENTS_KHR: {<br>
+                       VkMemoryDedicatedRequirementsK<wbr>HR *req =<br>
+                                      (<wbr>VkMemoryDedicatedRequirementsK<wbr>HR *) ext;<br>
+                       req-><wbr>requiresDedicatedAllocation = false;<br>
+                       req-><wbr>prefersDedicatedAllocation = req-><wbr>requiresDedicatedAllocation;<br>
+                       break;<br>
+               }<br>
+               default:<br>
+                       break;<br>
+               }<br>
+       }<br>
 }<br>
<br>
 void radv_<wbr>GetImageSparseMemoryRequiremen<wbr>ts(<br>
diff --git a/src/amd/vulkan/radv_<wbr>entrypoints_gen.py b/src/amd/vulkan/radv_<wbr>entrypoints_gen.py<br>
index d47a7011197..d305a07e7d7 100644<br>
--- a/src/amd/vulkan/radv_<wbr>entrypoints_gen.py<br>
+++ b/src/amd/vulkan/radv_<wbr>entrypoints_gen.py<br>
@@ -43,6 +43,7 @@ supported_extensions = [<br>
    'VK_KHR_xcb_surface',<br>
    'VK_KHR_xlib_surface',<br>
    'VK_KHR_get_memory_<wbr>requirements2',<br>
+   'VK_KHR_dedicated_allocation',<br>
 ]<br>
<br>
 # We generate a static hash table for entry point lookup<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.13.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>