问题
Are there any benefits to using a single vkMapMemory, a memsets for each write, and a single vkUnmapMemory as opposed to using a vkMapMemory, memset, and vkUnmapMemory for each write to a buffer?
回答1:
Yes, it is beneficial to map only once. vkMapMemory likely needs to do some system calls, so it is not free.
Authoritative quote, e.g. https://developer.samsung.com/game/usage#buffermanagement:
Frequent Map/Unmap calls should be avoided.
来源:https://stackoverflow.com/questions/59118275/should-i-call-vkmapmemory-each-time-i-write-to-a-buffer