Module: Mesa
Branch: main
Commit: 38a087c4ce2a398f33ab583f048d87bd6ac8178f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=38a087c4ce2a398f33ab583f048d87bd6ac8178f

Author: Paulo Zanoni <[email protected]>
Date:   Fri Jan 20 17:38:11 2023 -0800

anv: there's no need to set exec_obj offsets twice

The anv_execbuf_add_bo() function already sets the offsets for the
exec_objects. Since we're always using softpin and never using
relocations all these objects should have non-changing offsets, all
set during anv_bo creation and never changed. Not only we should not
change these offsets, we definitely don't change them between
anv_execbuf_add_bo() and this loop we're removing.

Previously, we'd have the offset set as -1 for BOs that had never been
submitted when we were not using softpin.

Notice that with games we can have several hundreds of BOs in this
array.

This loop was added by:
  c5f7e1f5b4a1 ("anv: Delete relocation support from batch submission")

Reviewed-by: José Roberto de Souza <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20885>

---

 src/intel/vulkan/i915/anv_batch_chain.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/intel/vulkan/i915/anv_batch_chain.c 
b/src/intel/vulkan/i915/anv_batch_chain.c
index 43fa371b698..eb14d5a481b 100644
--- a/src/intel/vulkan/i915/anv_batch_chain.c
+++ b/src/intel/vulkan/i915/anv_batch_chain.c
@@ -378,9 +378,6 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf,
          return result;
    }
 
-   for (uint32_t i = 0; i < execbuf->bo_count; i++)
-      execbuf->objects[i].offset = execbuf->bos[i]->offset;
-
    struct anv_batch_bo *first_batch_bo =
       list_first_entry(&cmd_buffers[0]->batch_bos, struct anv_batch_bo, link);
 

Reply via email to