zengine/engine/modules/render/vulkan/include/vkn/wrapper/commandpool.h

22 lines
521 B
C
Raw Normal View History

2024-08-23 22:13:05 +08:00
#pragma once
#include "commandbuffer.h"
namespace vkn {
class Device;
class Queue;
class CommandPool {
protected:
VkCommandPool mPtr;
Device& mDevice;
pmr::vector<CommandBuffer> mPool;
public:
CommandPool(Device& device, VkCommandPoolCreateFlags queueFlags, uint32_t queueIndex);
~CommandPool();
VkCommandBuffer AllocateBuffer(VkCommandBufferLevel level);
void FreeBuffer(VkCommandBuffer& buf);
VkCommandPool& Ptr() {
return mPtr;
};
CommandBuffer Pop();
void Push(CommandBuffer& cmd);
};
}