<div dir="ltr"><div>So, yeah, I also sent an implementation of this one... I'm not sure which is better.  Mine just does a bit more refactoring to keep things clean.  I hadn't even though about the fact that of course you implemented it too.<br><br></div>--Jason<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 7:10 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</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: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
 src/intel/vulkan/anv_device.c      | 32 ++++++++++++++++++++++++++++++<wbr>++<br>
 src/intel/vulkan/anv_<wbr>extensions.py |  1 +<br>
 src/intel/vulkan/anv_image.c       | 33 ++++++++++++++++++++++++++++++<wbr>+++<br>
 3 files changed, 66 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
index 8e2ed9eac45..4b30c0005fd 100644<br>
--- a/src/intel/vulkan/anv_device.<wbr>c<br>
+++ b/src/intel/vulkan/anv_device.<wbr>c<br>
@@ -1884,6 +1884,38 @@ VkResult anv_BindBufferMemory(<br>
    return VK_SUCCESS;<br>
 }<br>
<br>
+VkResult anv_BindBufferMemory2KHR(<br>
+    VkDevice                                    device,<br>
+    uint32_t                                    bindInfoCount,<br>
+    const VkBindBufferMemoryInfoKHR*            pBindInfos)<br>
+{<br>
+   VkResult result = VK_SUCCESS;<br>
+<br>
+   for (uint32_t i = 0; i < bindInfoCount; i++) {<br>
+      const VkBindBufferMemoryInfoKHR *bind_info = &pBindInfos[i];<br>
+<br>
+      if (bind_info->pNext == NULL) {<br>
+         result = anv_BindBufferMemory(device, bind_info->buffer,<br>
+                                       bind_info->memory,<br>
+                                       bind_info->memoryOffset);<br>
+      } else {<br>
+         vk_foreach_struct_const(s, pBindInfos->pNext) {<br>
+            switch (s->sType) {<br>
+            default:<br>
+               anv_debug_ignored_stype(s-><wbr>sType);<br>
+               break;<br>
+            }<br>
+         }<br>
+      }<br>
+<br>
+      /* Stop at the first error. */<br>
+      if (result != VK_SUCCESS)<br>
+         break;<br>
+   }<br>
+<br>
+   return result;<br>
+}<br>
+<br>
 VkResult anv_QueueBindSparse(<br>
     VkQueue                                     _queue,<br>
     uint32_t                                    bindInfoCount,<br>
diff --git a/src/intel/vulkan/anv_<wbr>extensions.py b/src/intel/vulkan/anv_<wbr>extensions.py<br>
index acec785959b..cb0e36b7233 100644<br>
--- a/src/intel/vulkan/anv_<wbr>extensions.py<br>
+++ b/src/intel/vulkan/anv_<wbr>extensions.py<br>
@@ -45,6 +45,7 @@ class Extension:<br>
             self.enable = enable;<br>
<br>
 EXTENSIONS = [<br>
+    Extension('VK_KHR_bind_<wbr>memory2',                      1, True),<br>
     Extension('VK_KHR_dedicated_<wbr>allocation',              1, True),<br>
     Extension('VK_KHR_descriptor_<wbr>update_template',        1, True),<br>
     Extension('VK_KHR_external_<wbr>fence',                    1,<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index 492b341303a..2aa83154f82 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -32,6 +32,7 @@<br>
 #include "util/debug.h"<br>
<br>
 #include "vk_format_info.h"<br>
+#include "vk_util.h"<br>
<br>
 /**<br>
  * Exactly one bit must be set in \a aspect.<br>
@@ -442,6 +443,38 @@ VkResult anv_BindImageMemory(<br>
    return VK_SUCCESS;<br>
 }<br>
<br>
+VkResult anv_BindImageMemory2KHR(<br>
+    VkDevice                                    device,<br>
+    uint32_t                                    bindInfoCount,<br>
+    const VkBindImageMemoryInfoKHR*             pBindInfos)<br>
+{<br>
+   VkResult result = VK_SUCCESS;<br>
+<br>
+   for (uint32_t i = 0; i < bindInfoCount; i++) {<br>
+      const VkBindImageMemoryInfoKHR *bind_info = &pBindInfos[i];<br>
+<br>
+      if (pBindInfos->pNext == NULL) {<br>
+         result = anv_BindImageMemory(device, bind_info->image,<br>
+                                      bind_info->memory,<br>
+                                      bind_info->memoryOffset);<br>
+      } else {<br>
+         vk_foreach_struct_const(s, bind_info->pNext) {<br>
+            switch (s->sType) {<br>
+            default:<br>
+               anv_debug_ignored_stype(s-><wbr>sType);<br>
+               break;<br>
+            }<br>
+         }<br>
+      }<br>
+<br>
+      /* Stop at the first error. */<br>
+      if (result != VK_SUCCESS)<br>
+         break;<br>
+   }<br>
+<br>
+   return result;<br>
+}<br>
+<br>
 static void<br>
 anv_surface_get_subresource_<wbr>layout(struct anv_image *image,<br>
                                    struct anv_surface *surface,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.1<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></div></div></div>