<div dir="ltr"><div><div>I thought I looked for this when doing maintenance1... oh well.<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div>Cc: "13.0 17.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 8:29 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">The spec section 5.2 says:<br>
<br>
   "vkAllocateCommandBuffers can be used to create multiple command<br>
   buffers. If the creation of any of those command buffers fails, the<br>
   implementation must destroy all successfully created command buffer<br>
   objects from this command, set all entries of the pCommandBuffers<br>
   array to VK_NULL_HANDLE and return the error."<br>
<br>
Fixes:<br>
   dEQP-VK.api.object_management.<wbr>alloc_callback_fail_multiple.<wbr>command_buffer_primary<br>
   dEQP-VK.api.object_management.<wbr>alloc_callback_fail_multiple.<wbr>command_buffer_secondary<br>
<br>
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_cmd_<wbr>buffer.c | 5 ++++-<br>
 1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_cmd_<wbr>buffer.c b/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
index 3a23048c47..5886fa63e6 100644<br>
--- a/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
+++ b/src/intel/vulkan/anv_cmd_<wbr>buffer.c<br>
@@ -232,9 +232,12 @@ VkResult anv_AllocateCommandBuffers(<br>
          break;<br>
    }<br>
<br>
-   if (result != VK_SUCCESS)<br>
+   if (result != VK_SUCCESS) {<br>
       anv_FreeCommandBuffers(_<wbr>device, pAllocateInfo->commandPool,<br>
                              i, pCommandBuffers);<br>
+      for (i = 0; i < pAllocateInfo-><wbr>commandBufferCount; i++)<br>
+         pCommandBuffers[i] = VK_NULL_HANDLE;<br>
+   }<br>
<br>
    return result;<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div>