mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
radv: always check entry count in descriptor pool when allocating
Previously this check was skipped for pools with VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT unset, but after96a240e1we need to check this otherwise we risk overflowing radv_descriptor_pool::entries into the host memory base This fixes a crash to desktop when launching Dota 2, which overallocates descriptor sets and expects an error to allocate another descriptor pool Fixes:96a240e176("radv: fix memory leak of descriptor set layout") Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16490> (cherry picked from commit580046e49f)
This commit is contained in:
parent
2cca7dce1e
commit
28264dd5c9
2 changed files with 6 additions and 3 deletions
|
|
@ -22,7 +22,7 @@
|
|||
"description": "radv: always check entry count in descriptor pool when allocating",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "96a240e176701f9b305c4bd273da9a8aee78e280"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -652,8 +652,11 @@ radv_descriptor_set_create(struct radv_device *device, struct radv_descriptor_po
|
|||
layout_size = align_u32(layout_size, 32);
|
||||
set->header.size = layout_size;
|
||||
|
||||
if (!pool->host_memory_base && pool->entry_count == pool->max_entry_count) {
|
||||
vk_free2(&device->vk.alloc, NULL, set);
|
||||
if (pool->entry_count == pool->max_entry_count) {
|
||||
if (!pool->host_memory_base) {
|
||||
vk_free2(&device->vk.alloc, NULL, set);
|
||||
}
|
||||
|
||||
return VK_ERROR_OUT_OF_POOL_MEMORY;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue