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

Author: Paulo Zanoni <[email protected]>
Date:   Thu Oct 12 12:36:08 2023 -0700

anv/sparse: join multiple NULL binds when possible

When it's a NULL bind we always set the bo_offset (aka memory offset)
to zero, so we have to avoid the "bind.offset == prev.offset + size"
check.

Reviewed-by: Lionel Landwerlin <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>

---

 src/intel/vulkan/anv_sparse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c
index bcf7ddb8917..75606fa92f9 100644
--- a/src/intel/vulkan/anv_sparse.c
+++ b/src/intel/vulkan/anv_sparse.c
@@ -716,7 +716,8 @@ anv_sparse_bind_image_memory(struct anv_queue *queue,
              anv_bind.op == prev_bind->op &&
              anv_bind.bo == prev_bind->bo &&
              anv_bind.address == prev_bind->address + prev_bind->size &&
-             anv_bind.bo_offset == prev_bind->bo_offset + prev_bind->size) {
+             (anv_bind.bo_offset == prev_bind->bo_offset + prev_bind->size ||
+              anv_bind.bo == NULL)) {
             prev_bind->size += anv_bind.size;
          } else {
             binds[num_binds] = anv_bind;

Reply via email to