mirror of https://github.com/bjornbytes/lovr.git
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:
parent
cbe3c45548
commit
72ecd9cb04
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue