4#include <vulkan/vulkan.h>
17 VkFenceCreateInfo fenceInfo{};
18 fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
19 fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
21 if (VkResult result = vkCreateFence(+virtualGpu, &fenceInfo,
nullptr, &fence); result != VK_SUCCESS) {
25 std::cout <<
"\n+ Fence created";
32 Fence(
Fence&& movedFrom) noexcept : fence{ movedFrom.fence }, virtualGpu{ movedFrom.virtualGpu } {
33 movedFrom.fence =
nullptr;
34 std::cout <<
"\n> Fence moved";
41 vkDestroyFence(+virtualGpu, fence,
nullptr);
42 std::cout <<
"\n- Fence destroyed";
A logical device is an abstraction of the physical GPU which we can mainly use to send commands.
Definition: LogicalDevice.h:15
Fence & operator=(const Fence &)=delete
Fence(const LogicalDevice &virtualGpu)
Definition: Fence.h:16
Fence(Fence &&movedFrom) noexcept
Definition: Fence.h:32
~Fence()
Definition: Fence.h:40
const VkFence & operator+() const
Definition: Fence.h:45
Fence(const Fence &)=delete
Fence & operator=(Fence &&)=default
Generic runtime exception thrown by Vulkan-related functions.
Definition: VulkanException.h:13
Definition: Barriers.h:10