21 Mar
2023
21 Mar
'23
3:28 p.m.
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. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/131#note_27418