class render::GpuCommandBufferPool

Allows creation of command buffers.

All allocated command buffers may only be used on the GPU queues that have the subset of usage flags provided by this pool. Command buffer and all command buffers allocated from the command buffer may only be used on a single thread. Command buffers may only be used on another thread as part of command buffer submission.

Public

Methods

~GpuCommandBufferPool

virtual ~GpuCommandBufferPool() = default

GetMessageQueue

SingleConsumerQueue &GetMessageQueue()

Returns queue that may be used for posting messages to the command buffer pool (e.g. command buffer completion notifies).

GetUsePoolReset

bool GetUsePoolReset() const

Returns true if the pool uses pool-level reset instead of individual command buffer reset.

Create

virtual SPtr<GpuCommandBuffer> Create(const GpuCommandBufferCreateInformation &createInformation) = 0

Creates a new command buffer.

FindOrCreate

virtual SPtr<GpuCommandBuffer> FindOrCreate(const GpuCommandBufferCreateInformation &createInformation) = 0

Attempts to find a free command buffer from the pool, or creates a new one if it cannot be found.

Reset

virtual void Reset() = 0

Resets the command buffer pool, allowing all previously allocated command buffers to be re-used.

Must be called only after all previously allocated command buffers have completed executing.

Destroy

virtual void Destroy()

Destroys the pool.

Will be called automatically on destruction, but may be called earlier if desired.

Protected

Constructors

GpuCommandBufferPool

GpuCommandBufferPool(GpuDevice &gpuDevice, const GpuCommandBufferPoolCreateInformation &createInformation)

Methods

EnsureValidThread

void EnsureValidThread() const

Reports an error if the current thread is not the thread associated with the object.

Fields

mGpuDevice

GpuDevice & mGpuDevice

mInformation

mMessageQueue

SingleConsumerQueue mMessageQueue

mIsDestroyed

bool mIsDestroyed