<div dir="ltr"><div class="gmail_extra"><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></blockquote><div><br></div><div>This could be memset...  I don't care that much.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+   }<br>
<br>
    return result;<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
</font></span></blockquote></div><br></div></div>