gpt4 book ai didi

vulkan - 在 Vulkan 中取消映射后是否可以刷新设备内存?

转载 作者:行者123 更新时间:2023-12-04 18:56:35 26 4
gpt4 key购买 nike

取消映射后可以刷新内存范围吗?

乍一看好像不对,因为函数叫vkFlushMappedMemoryRanges() ,但是 the documentation似乎暗示内存已准备好刷新,即使在未映射之后:

Unmapping non-coherent memory does not implicitly flush the mapped memory, and host writes that have not been flushed may not ever be visible to the device. However, implementations must ensure that writes that have not been flushed do not become visible to any other memory.

最佳答案

vkFlushMappedMemoryRanges()的有效使用规则之一是所有的VkMappedMemoryRange结构必须有效。该结构的有效性规则说:

memory must be currently mapped



因此,如果您取消了内存映射,则无法刷新它。

然而,冲洗确实说:

bytes in that range is flushed if any byte in that set has been written by the host since it was first mapped, or the last time it was flushed.



很明显,如果您取消映射然后再次映射它,您可以刷新它并仍然看到数据。就个人而言,我不会指望它。

关于vulkan - 在 Vulkan 中取消映射后是否可以刷新设备内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51254792/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com