mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
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:
parent
e98bbcad17
commit
1fa171650a
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue