Vulkan util Fence class
This commit is contained in:
parent
f75e5fec24
commit
2bb40c122d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue