vulkan API 复制什么?
What does vulkan API copy?
当应用程序调用 Vulkan API 命令时,在某些情况下,会传递指向应用程序拥有的内存的指针。 Vulkan 是否存储过传递给它的指针?你怎么知道的?
例如,我们以vkCmdWaitEvents
命令为例。我将 pEvents
指针传递给 VkEvent
数组。在 vkCmdWaitEvents
returns 之后,我可以立即删除那个数组吗?还是我必须等到等待执行完毕并且封闭的 CommandBuffer 被销毁?即 vulkan 获取数组的副本,还是只存储指向数组第一个元素的指针?你怎么知道是哪个?
从来没有。
The ownership of application-owned memory is immediately acquired by any Vulkan command it is passed into. Ownership of such memory must be released back to the application at the end of the duration of the command, so that the application can alter or free this memory as soon as all the commands that acquired it have returned.
指针必须对多个调用保持有效的唯一情况是当它用作 pUserData
回调(如 VkDebugReportCallbackCreateInfoEXT
或分配回调)时。
当应用程序调用 Vulkan API 命令时,在某些情况下,会传递指向应用程序拥有的内存的指针。 Vulkan 是否存储过传递给它的指针?你怎么知道的?
例如,我们以vkCmdWaitEvents
命令为例。我将 pEvents
指针传递给 VkEvent
数组。在 vkCmdWaitEvents
returns 之后,我可以立即删除那个数组吗?还是我必须等到等待执行完毕并且封闭的 CommandBuffer 被销毁?即 vulkan 获取数组的副本,还是只存储指向数组第一个元素的指针?你怎么知道是哪个?
从来没有。
The ownership of application-owned memory is immediately acquired by any Vulkan command it is passed into. Ownership of such memory must be released back to the application at the end of the duration of the command, so that the application can alter or free this memory as soon as all the commands that acquired it have returned.
指针必须对多个调用保持有效的唯一情况是当它用作 pUserData
回调(如 VkDebugReportCallbackCreateInfoEXT
或分配回调)时。