Class CommandPool#

Inheritance Relationships#

Derived Type#

Class Documentation#

class CommandPool#

Subclassed by TRAP::Graphics::API::VulkanCommandPool

Public Functions

virtual ~CommandPool()#

Destructor.

consteval CommandPool(const CommandPool&) noexcept = delete#

Copy constructor.

consteval CommandPool &operator=(const CommandPool&) noexcept = delete#

Copy assignment operator.

CommandPool(CommandPool&&) noexcept = default#

Move constructor.

CommandPool &operator=(CommandPool&&) noexcept = default#

Move assignment operator.

virtual CommandBuffer &GetCommandBuffer(bool secondary, std::string_view name = "") = 0#

Retrieve a new command buffer.

Note

The lifetime of the command buffer ends when the command pool gets destroyed or when ReleaseCommandBuffer() gets called.

Parameters:
  • secondary – Should the command buffer be a secondary command buffer.

  • nameOptional: Name for the command buffer.

Returns:

Newly created command buffer.

virtual void ReleaseCommandBuffer(const CommandBuffer &cmdBuffer) = 0#

Release a command buffer.

Parameters:

cmdBuffer – Command buffer to release.

virtual void Reset() const = 0#

Reset the command pool. All allocated command buffers are reset to their initial state (i.e. valid non-recording).

Public Static Functions

static TRAP::Ref<CommandPool> Create(const RendererAPI::CommandPoolDesc &desc)#

Create a new command pool from the given description.

Parameters:

desc – Command pool description.

Returns:

Created command pool.

Protected Functions

explicit CommandPool(TRAP::Ref<TRAP::Graphics::Queue> queue)#

Constructor.

Protected Attributes

std::vector<TRAP::Scope<CommandBuffer>> m_commandBuffers = {}#
TRAP::Ref<Queue> m_queue = nullptr#