Reputation: 153
I have a Vulkan memory mapping which has the same lifetime as its corresponding VkDeviceMemory. Currently I am unmapping it before the VkDeviceMemory gets destroyed. However, I am wondering about whether this step is compulsory as avoiding it will reduce my class' memory footprint.
Trying it with validation layers enabled does not complain, however this error detection might not be implemented.
So, is it compulsory to unmap Vulkan memory before deallocating it?
Edit: documentation is not explicit about it
Upvotes: 0
Views: 411
Reputation: 473272
The Vulkan specification says:
If a memory object is mapped at the time it is freed, it is implicitly unmapped.
So clearly, there's no problem with freeing memory without unmapping it.
Upvotes: 1