本文整理汇总了C++中NativeHandle::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ NativeHandle::reset方法的具体用法?C++ NativeHandle::reset怎么用?C++ NativeHandle::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeHandle
的用法示例。
在下文中一共展示了NativeHandle::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importSemaphore
void importSemaphore (const vk::DeviceInterface& vkd,
const vk::VkDevice device,
const vk::VkSemaphore semaphore,
vk::VkExternalSemaphoreHandleTypeFlagBitsKHR externalType,
NativeHandle& handle,
vk::VkSemaphoreImportFlagsKHR flags)
{
if (externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR
|| externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR)
{
const vk::VkImportSemaphoreFdInfoKHR importInfo =
{
vk::VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
DE_NULL,
semaphore,
flags,
externalType,
handle.getFd()
};
VK_CHECK(vkd.importSemaphoreFdKHR(device, &importInfo));
handle.disown();
}
else if (externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR
|| externalType == vk::VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR)
{
const vk::VkImportSemaphoreWin32HandleInfoKHR importInfo =
{
vk::VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
DE_NULL,
semaphore,
flags,
externalType,
handle.getWin32Handle(),
DE_NULL
};
VK_CHECK(vkd.importSemaphoreWin32HandleKHR(device, &importInfo));
// \note File descriptors and win32 handles behave differently, but this call wil make it seem like they would behave in same way
handle.reset();
}
else
DE_FATAL("Unknown semaphore external handle type");
}