NDEVR
API Documentation
VulkanComputeDevice

Wraps a VulkanDevice with compute-specific queue discovery and command pool management. More...

Public Member Functions

Buffer< VkCommandBuffer > allocateComputeCommandBuffers (uint04 count) const
 Allocate a batch of command buffers in a single Vulkan call.
VkCommandBuffer batchCommandBuffer () const
 Returns the active batch command buffer, or VK_NULL_HANDLE if no batch is active.
VkCommandBuffer beginComputeCommands () const
 Allocate and begin a one-time-use compute command buffer.
void beginTransferBatch () const
 Begin a transfer batch.
VkCommandPool computeCommandPool () const
 Get the compute command pool.
uint04 computeFamilyIndex () const
 Index of the compute queue family.
VkQueue computeQueue () const
 Get the compute queue.
VkDevice device () const
 Get the VkDevice handle.
void endComputeCommands (VkCommandBuffer cmd, bool wait_for_completion) const
 End, submit, and optionally wait for a compute command buffer.
void endTransferBatch () const
 End the transfer batch: submit the batched command buffer and wait for completion.
uint04 findMemoryType (uint04 type_filter, uint04 properties) const
 Find a memory type index matching the given filter and properties.
void freeComputeCommandBuffers (const Buffer< VkCommandBuffer > &cmds) const
 Free a batch of command buffers.
bool hasDedicatedComputeQueue () const
 Whether the compute queue is dedicated (not the graphics queue).
void resetComputeCommandBuffer (VkCommandBuffer cmd) const
 Reset a previously submitted (or freshly allocated) command buffer and begin recording.
void submitComputeCommands (VkCommandBuffer cmd) const
 End and submit a command buffer without waiting or freeing.
bool supportsCompute () const
 Whether this device has a usable compute queue.
const ConstPointer< VulkanDevice > & vulkanDevice () const
 Access the underlying VulkanDevice.
void waitComputeQueue () const
 Block until all work on the compute queue has completed.

Detailed Description

Wraps a VulkanDevice with compute-specific queue discovery and command pool management.


Discovers a queue family supporting VK_QUEUE_COMPUTE_BIT (preferring a dedicated compute queue when available for async overlap with graphics), creates a dedicated command pool, and provides helpers for one-shot compute dispatches.

Definition at line 45 of file VulkanComputeDevice.h.

Member Function Documentation

◆ allocateComputeCommandBuffers()

Buffer< VkCommandBuffer > VulkanComputeDevice::allocateComputeCommandBuffers ( uint04 count) const

Allocate a batch of command buffers in a single Vulkan call.

Returned buffers are in the initial state — call resetComputeCommandBuffer() to transition to recording before use.

◆ beginTransferBatch()

void VulkanComputeDevice::beginTransferBatch ( ) const

Begin a transfer batch.

All VulkanComputeBuffer::copyBuffer() calls between beginTransferBatch() and endTransferBatch() are recorded into a single command buffer and submitted once, avoiding per-buffer GPU round-trips.

◆ resetComputeCommandBuffer()

void VulkanComputeDevice::resetComputeCommandBuffer ( VkCommandBuffer cmd) const

Reset a previously submitted (or freshly allocated) command buffer and begin recording.

Reusable across phases without reallocating.

◆ submitComputeCommands()

void VulkanComputeDevice::submitComputeCommands ( VkCommandBuffer cmd) const

End and submit a command buffer without waiting or freeing.

Caller must call waitComputeQueue() before reuse or free.


The documentation for this class was generated from the following file: