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 <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26036>
This commit is contained in:
Paulo Zanoni 2023-10-12 12:36:08 -07:00 committed by Marge Bot
parent 2fc0bbe814
commit b94d7dbe66

View file

@ -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;