Split CommandBuffer into Auto and normal variants

This commit is contained in:
Lynix
2020-03-26 21:09:58 +01:00
parent 91a5e70ac5
commit e53e15d1aa
7 changed files with 123 additions and 13 deletions

View File

@@ -9,6 +9,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Math/Rect.hpp>
#include <Nazara/VulkanRenderer/Wrapper/AutoFree.hpp>
#include <Nazara/VulkanRenderer/Wrapper/DescriptorPool.hpp>
#include <vulkan/vulkan.h>
@@ -24,7 +25,7 @@ namespace Nz
inline DescriptorSet();
DescriptorSet(const DescriptorSet&) = delete;
inline DescriptorSet(DescriptorSet&& descriptorSet) noexcept;
inline ~DescriptorSet();
~DescriptorSet() = default;
inline void Free();
@@ -56,6 +57,15 @@ namespace Nz
DescriptorPool* m_pool;
VkDescriptorSet m_handle;
};
class AutoDescriptorSet : public AutoFree<DescriptorSet>
{
public:
using AutoFree::AutoFree;
explicit operator bool() const { return Get(); }
operator VkDescriptorSet() const { return Get(); }
};
}
}