每次写入缓冲区时都应该调用 `vkMapMemory` 吗? [英] Should I call `vkMapMemory` each time I write to a buffer?

查看:75
本文介绍了每次写入缓冲区时都应该调用 `vkMapMemory` 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用单个 vkMapMemory、每次写入使用一个 memset 和单个 vkUnmapMemory 与使用单个 vkUnmapMemory 相比有什么好处吗?vkMapMemorymemsetvkUnmapMemory 用于每次写入缓冲区?

解决方案

是的,只映射一次是有益的.vkMapMemory 可能需要做一些系统调用,所以它不是免费的.

权威报价,例如https://developer.samsung.com/game/usage#buffermanagement::><块引用>

应避免频繁的 Map/Unmap 调用.

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?

解决方案

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.

这篇关于每次写入缓冲区时都应该调用 `vkMapMemory` 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆