Now that all callers request and use the relocation target address, we
can unconditionally pass it back and so enforce that the caller does
supply it (and we hope uses it!).

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
---
 src/intel/vulkan/anv_batch_chain.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c 
b/src/intel/vulkan/anv_batch_chain.c
index fe27038cd3..10a0466767 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -219,8 +219,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    int index;
 
    /* The address written into the batch must always match presumed_offset. */
-   if (address)
-      *address = gen8_canonical_address(presumed_offset + delta);
+   *address = gen8_canonical_address(presumed_offset + delta);
 
    /* The array of unique bo should be reasonably small */
    for (index = 0; index < list->num_bos; index++)
@@ -229,7 +228,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
 
    if (index == list->num_bos) {
       result = anv_reloc_list_grow_bos(list, alloc, 1);
-      if (result != VK_SUCCESS)
+      if (unlikely(result != VK_SUCCESS))
          return result;
 
       index = list->num_bos++;
@@ -240,7 +239,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
       (target_bo->flags & EXEC_OBJECT_WRITE) ? I915_GEM_DOMAIN_RENDER : 0;
 
    result = anv_reloc_list_grow_relocs(list, alloc, 1);
-   if (result != VK_SUCCESS)
+   if (unlikely(result != VK_SUCCESS))
       return result;
 
    struct drm_i915_gem_relocation_entry *entry;
-- 
2.11.0

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to