Fix issue recycling GPU memory blocks;

When a memory block is used for host-visible memory, its mapped pointer
is tracked with the block.  If that memory is freed and later re-used
for some non-mappable memory, the pointer never gets cleared, and so
code thinks the memory is mappable and tries to use the pointer.
This commit is contained in:
bjorn 2022-11-27 19:53:31 -08:00
parent cbe3c45548
commit 72ecd9cb04
1 changed files with 1 additions and 0 deletions

View File

@ -2597,6 +2597,7 @@ static gpu_memory* gpu_allocate(gpu_memory_type type, VkMemoryRequirements info,
static void gpu_release(gpu_memory* memory) {
if (memory && --memory->refs == 0) {
condemn(memory->handle, VK_OBJECT_TYPE_DEVICE_MEMORY);
memory->pointer = NULL;
memory->handle = NULL;
for (uint32_t i = 0; i < COUNTOF(state.allocators); i++) {