Vulkan util Fence class

This commit is contained in:
Dr. Chat 2016-03-25 16:36:21 -05:00
parent f75e5fec24
commit 2bb40c122d
1 changed files with 26 additions and 0 deletions

View File

@ -25,6 +25,32 @@ namespace xe {
namespace ui {
namespace vulkan {
class Fence {
public:
Fence(VkDevice device) : device_(device) {
VkFenceCreateInfo fence_info;
fence_info.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
fence_info.pNext = nullptr;
fence_info.flags = 0;
vkCreateFence(device, &fence_info, nullptr, &fence_);
}
~Fence() {
vkDestroyFence(device_, fence_, nullptr);
fence_ = nullptr;
}
VkResult status() const {
return vkGetFenceStatus(device_, fence_);
}
VkFence fence() const { return fence_; }
operator VkFence() const { return fence_; }
private:
VkDevice device_;
VkFence fence_ = nullptr;
};
struct Version {
uint32_t major;
uint32_t minor;