Vulkan: Add support for semaphores

Former-commit-id: 429c5b61dd3a8c9666e2cf0d94f17d353e4e59f0
This commit is contained in:
Lynix
2016-04-30 11:44:02 +02:00
parent d87b0587d7
commit 8a8731f330
2 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKAN_VKSEMAPHORE_HPP
#define NAZARA_VULKAN_VKSEMAPHORE_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Vulkan/Config.hpp>
#include <Nazara/Vulkan/VkLoader.hpp>
#include <vulkan/vulkan.h>
namespace Nz
{
namespace Vk
{
class Device;
class NAZARA_VULKAN_API Semaphore
{
public:
inline Semaphore(Device& instance);
Semaphore(const Semaphore&) = delete;
Semaphore(Semaphore&&) = delete;
inline ~Semaphore();
inline bool Create(const VkSemaphoreCreateInfo& createInfo, const VkAllocationCallbacks* allocator = nullptr);
inline bool Create(VkSemaphoreCreateFlags flags = 0, const VkAllocationCallbacks* allocator = nullptr);
inline void Destroy();
inline VkResult GetLastErrorCode() const;
Semaphore& operator=(const Semaphore&) = delete;
Semaphore& operator=(Semaphore&&) = delete;
inline operator VkSemaphore();
private:
Device& m_device;
VkAllocationCallbacks m_allocator;
VkSemaphore m_semaphore;
VkResult m_lastErrorCode;
};
}
}
#include <Nazara/Vulkan/VkSemaphore.inl>
#endif // NAZARA_VULKAN_VKSEMAPHORE_HPP