Giovanni Mascellani (@giomasce) commented about libs/vkd3d/resource.c:
if (!heap->is_private) d3d12_device_add_ref(heap->device);
- if (d3d12_heap_get_memory_property_flags(heap) & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
- {
if ((vr = VK_CALL(vkMapMemory(device->vk_device,
heap->vk_memory, 0, VK_WHOLE_SIZE, 0, &heap->map_ptr))) < 0)
My reading of the specs is that `vkMapMemory()` is not required to leave `heap->map_ptr` untouched if it fails. Since `d3d12_heap_destroy()` relies on that value being `NULL` to avoid unmapping twice, maybe the pointer should be explicitly reset to `NULL` in the failure branch.