mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
llvmpipe: handle vma allocation failure
Fixes: a062544d3d ("llvmpipe: Use an anonymous file for memory allocations")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30229>
This commit is contained in:
parent
3e01422a16
commit
a8ff1bdc83
1 changed files with 5 additions and 0 deletions
|
|
@ -1305,6 +1305,11 @@ llvmpipe_allocate_memory(struct pipe_screen *_screen, uint64_t size)
|
|||
mtx_lock(&screen->mem_mutex);
|
||||
|
||||
mem->offset = util_vma_heap_alloc(&screen->mem_heap, mem->size, alignment);
|
||||
if (!mem->offset) {
|
||||
mtx_unlock(&screen->mem_mutex);
|
||||
FREE(mem);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (mem->offset + mem->size > screen->mem_file_size) {
|
||||
/* expand the anonymous file */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue