Should I call `vkMapMemory` each time I write to a buffer?

自作多情 提交于 2021-02-11 13:36:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!