11 Fence::Fence(bool create_signaled):
12 device(Device::get_current())
14 const VulkanFunctions &vk = device.get_functions();
16 VkFenceCreateInfo fence_info = { };
17 fence_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
18 fence_info.flags = (create_signaled ? VK_FENCE_CREATE_SIGNALED_BIT : 0);
20 vk.CreateFence(fence_info, handle);
23 Fence::Fence(Fence &&other):
33 device.get_destroy_queue().destroy(handle);
36 bool Fence::get_status()
38 const VulkanFunctions &vk = device.get_functions();
40 Result result = vk.GetFenceStatus(handle);
41 if(result==VK_NOT_READY)
51 const VulkanFunctions &vk = device.get_functions();
53 vk.ResetFences(1, &handle);
58 const VulkanFunctions &vk = device.get_functions();
60 vk.WaitForFences(1, &handle, VK_TRUE, numeric_limits<uint64_t>::max());