zink: remove invalid scope in bo allocation loop

The braces resulted in the never demoting the heap type
which resulted in an infinite loop if this become a necessity.

Fixes:  eb394f5316
    zink: redesign the allocation try loop to test all heaps

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27446>
This commit is contained in:
Gert Wollny
2024-02-02 22:42:44 +01:00
committed by Marge Bot
parent e98bbcad17
commit 1fa171650a

View File

@@ -1058,7 +1058,7 @@ allocate_bo(struct zink_screen *screen, const struct pipe_resource *templ,
obj->bo = zink_bo(zink_bo_create(screen, reqs->size, alignment, heap, mai.pNext ? ZINK_ALLOC_NO_SUBALLOC : 0, mai.memoryTypeIndex, mai.pNext));
}
if (obj->bo || heap != ZINK_HEAP_DEVICE_LOCAL_VISIBLE) {
if (obj->bo || heap != ZINK_HEAP_DEVICE_LOCAL_VISIBLE)
break;
/* demote BAR allocations to a different heap on failure to avoid oom */
@@ -1066,7 +1066,6 @@ allocate_bo(struct zink_screen *screen, const struct pipe_resource *templ,
heap = ZINK_HEAP_HOST_VISIBLE_COHERENT;
else
heap = ZINK_HEAP_DEVICE_LOCAL;
}
};
return obj->bo ? roc_success : roc_fail_and_cleanup_object;