VULKAN-HPP:VK :: unique Handle和VK :: Raii包装器有什么区别?
我读了 new raii rapper -HPP API。 看来vk :: uniqueHandle< t>
和raii包装器都是移动唯一的对象,这些对象会破坏其在破坏者中的手柄。
似乎有一个区别是,RAII变体不能默认构建,而unique
可以。
另一个区别是,RAII变体似乎需要vk :: raii :: context
类要实例化并通过。
那么,为什么它们都存在呢?应该首选哪一个?在哪种情况下? 为什么RAII变体需要上下文对象?
I read the documentation of the new raii wrappers in the Vulkan-Hpp API.
It seems that both vk::UniqueHandle<T>
and the raii wrappers are move only objects that destruct their handle in their destructors.
One difference seems to be is that the raii variants cannot be default constructed whereas the UniqueHandle
ones can.
Another difference is that the raii variant seem to require the vk::raii::Context
class to be instantiated and passed around.
So why both of them exists? Which one should be preferred and in what scenarios?
Why do the raii variants require the Context object?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论