本文整理汇总了C++中semaphore::signal_host方法的典型用法代码示例。如果您正苦于以下问题:C++ semaphore::signal_host方法的具体用法?C++ semaphore::signal_host怎么用?C++ semaphore::signal_host使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类semaphore
的用法示例。
在下文中一共展示了semaphore::signal_host方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acquire_swapchain_image_impl
ste_presentation_surface::acquire_next_image_return_t ste_presentation_surface::acquire_swapchain_image_impl(
std::uint64_t timeout_ns,
semaphore &presentation_image_ready_semaphore,
const vk::vk_fence<> *presentation_image_ready_fence) const
{
acquire_next_image_return_t ret;
vk::vk_result res = vkAcquireNextImageKHR(*presentation_device,
*swap_chain,
timeout_ns,
presentation_image_ready_semaphore ? static_cast<VkSemaphore>(*presentation_image_ready_semaphore) : vk::vk_null_handle,
presentation_image_ready_fence ? static_cast<VkFence>(*presentation_image_ready_fence) : vk::vk_null_handle,
&ret.image_index);
// Host signal semaphore
presentation_image_ready_semaphore.signal_host();
switch (res.get()) {
case VK_SUBOPTIMAL_KHR:
ret.sub_optimal = true;
case VK_SUCCESS:
ret.image = &swap_chain_images[ret.image_index];
break;
case VK_ERROR_OUT_OF_DATE_KHR:
ret.sub_optimal = true;
break;
default:
throw vk::vk_exception(res);
}
// Furthermore raise flag to recreate swap-chain
if (res != VK_SUCCESS)
shared_data.swap_chain_optimal_flag.clear(std::memory_order_release);
return ret;
}