<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/intel/vulkan/anv_batch_<wbr>chain.c | 10 ++++++----<br>
 1 file changed, 6 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_batch_<wbr>chain.c b/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
index 3f6039e..4cbfb4d 100644<br>
--- a/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
+++ b/src/intel/vulkan/anv_batch_<wbr>chain.c<br>
@@ -151,8 +151,9 @@ anv_reloc_list_add(struct anv_reloc_list *list,<br>
    const uint32_t domain =<br>
       target_bo->is_winsys_bo ? I915_GEM_DOMAIN_RENDER : 0;<br>
<br>
-   anv_reloc_list_grow(list, alloc, 1);<br>
-   /* TODO: Handle failure */<br>
+   VkResult result = anv_reloc_list_grow(list, alloc, 1);<br>
+   if (result != VK_SUCCESS)<br>
+      return 0;<br></blockquote><div><br></div><div>This prevents crashes, yes, but it doesn't flag the failure anywhere so it gets lost and you now have  command buffer that references something but doesn't have a relocaiton.<br><br></div><div>I think the right thing to do would be to add an anv_batch_emit_surface_reloc helper and then we have a more central place to handle it.<br><br></div><div>Would it make sense to put the VkResult status in the anv_batch?  This can get called from either batch building or pipeline building.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    /* XXX: Can we use I915_EXEC_HANDLE_LUT? */<br>
    index = list->num_relocs++;<br>
@@ -174,8 +175,9 @@ anv_reloc_list_append(struct anv_reloc_list *list,<br>
                       const VkAllocationCallbacks *alloc,<br>
                       struct anv_reloc_list *other, uint32_t offset)<br>
 {<br>
-   anv_reloc_list_grow(list, alloc, other->num_relocs);<br>
-   /* TODO: Handle failure */<br>
+   VkResult result = anv_reloc_list_grow(list, alloc, other->num_relocs);<br>
+   if (result != VK_SUCCESS)<br>
+      return;<br></blockquote><div><br></div><div>Similarly, this one should handle failure.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    memcpy(&list->relocs[list-><wbr>num_relocs], &other->relocs[0],<br>
           other->num_relocs * sizeof(other->relocs[0]));<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<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>