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/CommandPool.hpp>
#include <vulkan/vulkan.h>
@@ -24,7 +25,7 @@ namespace Nz
inline CommandBuffer();
CommandBuffer(const CommandBuffer&) = delete;
inline CommandBuffer(CommandBuffer&& commandBuffer);
inline ~CommandBuffer();
~CommandBuffer() = default;
inline bool Begin(const VkCommandBufferBeginInfo& info);
inline bool Begin(VkCommandBufferUsageFlags flags = 0);
@@ -90,10 +91,16 @@ namespace Nz
inline CommandBuffer(CommandPool& pool, VkCommandBuffer handle);
CommandPool* m_pool;
VkAllocationCallbacks m_allocator;
VkCommandBuffer m_handle;
VkResult m_lastErrorCode;
};
class AutoCommandBuffer : public AutoFree<CommandBuffer>
{
public:
using AutoFree::AutoFree;
operator VkCommandBuffer() const { return Get(); }
};
}
}