1#ifndef VULKAN_SEMAPHORE
2#define VULKAN_SEMAPHORE
4#include <vulkan/vulkan.h>
17 VkSemaphoreCreateInfo semaphoreInfo{};
18 semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
20 if (VkResult result = vkCreateSemaphore(+virtualGpu, &semaphoreInfo,
nullptr, &semaphore); result != VK_SUCCESS) {
24 std::cout <<
"\n+ Semaphore created";
31 Semaphore(
Semaphore&& movedFrom) noexcept : semaphore{ movedFrom.semaphore }, virtualGpu{ movedFrom.virtualGpu } {
32 movedFrom.semaphore =
nullptr;
33 std::cout <<
"\n> Semaphore moved";
40 vkDestroySemaphore(+virtualGpu, semaphore,
nullptr);
41 std::cout <<
"\n- Semaphore destroyed";
50 VkSemaphore semaphore;
A logical device is an abstraction of the physical GPU which we can mainly use to send commands.
Definition: LogicalDevice.h:15
Definition: Semaphore.h:13
const VkSemaphore & operator+() const
Definition: Semaphore.h:44
Semaphore(const Semaphore &)=delete
~Semaphore()
Definition: Semaphore.h:39
Semaphore(const LogicalDevice &virtualGpu)
Definition: Semaphore.h:16
Semaphore(Semaphore &&movedFrom) noexcept
Definition: Semaphore.h:31
Semaphore & operator=(Semaphore &&)=default
Semaphore & operator=(const Semaphore &)=delete
Generic runtime exception thrown by Vulkan-related functions.
Definition: VulkanException.h:13
Definition: Barriers.h:10