tp::CommandList class

An abstract class that implements common functionality for recording commands inside either a compute or render pass. See tp::ComputeList and tp::RenderList for further details.

Derived classes

class ComputeList
Provides an interface to directly record compute commands into a Vulkan VkCommandBuffer inside a compute pass.
class RenderList
Provides an interface to directly record graphics commands into a Vulkan VkCommandBuffer inside a compute pass.

Public functions

void cmdBeginDebugLabel(const char* name, ArrayParameter<const float> color = {})
Begins a debug label, marking the following commands until the next tp::CommandList::cmdEndDebugLabel with the given name and optional color for display in validation and debugging tools.
void cmdBindDescriptorSets(const PipelineLayout& pipelineLayout, ArrayParameter<const DescriptorSetView> descriptorSets, uint32_t firstSet = 0, ArrayParameter<const uint32_t> dynamicOffsets = {})
Binds descriptor sets for use in the subsequent commands.
void cmdEndDebugLabel()
Ends the last debug label. Must be preceded by tp::CommandList::cmdBeginDebugLabel.
void cmdInsertDebugLabel(const char* name, ArrayParameter<const float> color = {})
Inserts a debug label, marking the following commands with the given name and optional color for display in validation and debugging tools.
template<typename T>
void cmdPushConstants(const PipelineLayout& pipelineLayout, ShaderStageMask stageMask, const T& value, uint32_t offsetBytes = 0)
Updates the push constant values using the given pipeline layout.
void cmdPushConstants(const PipelineLayout& pipelineLayout, ShaderStageMask stageMask, const void* data, uint32_t sizeBytes, uint32_t offsetBytes = 0)
Updates the push constant values using the given pipeline layout.
auto isNull() const -> bool
Returns true if the command list is null and not valid for use.
auto vkGetCommandBufferHandle() const -> VkCommandBufferHandle
Returns the associated VkCommandBuffer handle if the command list is being recorded, VK_NULL_HANDLE otherwise.

Function documentation

void tp::CommandList::cmdBeginDebugLabel(const char* name, ArrayParameter<const float> color = {})

Begins a debug label, marking the following commands until the next tp::CommandList::cmdEndDebugLabel with the given name and optional color for display in validation and debugging tools.

Parameters
name The name of the label.
color The color of the label. Only used by external tools.

void tp::CommandList::cmdBindDescriptorSets(const PipelineLayout& pipelineLayout, ArrayParameter<const DescriptorSetView> descriptorSets, uint32_t firstSet = 0, ArrayParameter<const uint32_t> dynamicOffsets = {})

Binds descriptor sets for use in the subsequent commands.

Parameters
pipelineLayout The tp::PipelineLayout used to program the bindings.
descriptorSets An array of pointers to tp::DescriptorSet to bind.
firstSet The set number in the pipeline layout that the first provided descriptor set will be bound to.
dynamicOffsets The dynamic offsets to be applied to the provided descriptors of types tp::DescriptorType::UniformBufferDynamic or tp::DescriptorType::StorageBufferDynamic in the order they appear in the descriptor sets. The size of the array must match the number of dynamic buffer descriptors to be bound. Each offset moves the entire range of its corresponding buffer view within its parent buffer. E.g. a buffer view offset by 64 bytes and a size of 32 bytes will expose bytes 128-159 of the viewed buffer when bound with a dynamic offset value of 64.

The provided descriptor sets are bound consecutively, meaning the first descriptor set gets bound to set number firstSet, the second one to firstSet + 1 and so on.

void tp::CommandList::cmdEndDebugLabel()

Ends the last debug label. Must be preceded by tp::CommandList::cmdBeginDebugLabel.

void tp::CommandList::cmdInsertDebugLabel(const char* name, ArrayParameter<const float> color = {})

Inserts a debug label, marking the following commands with the given name and optional color for display in validation and debugging tools.

Parameters
name The name of the label.
color The color of the label. Only used by external tools.

template<typename T>
void tp::CommandList::cmdPushConstants(const PipelineLayout& pipelineLayout, ShaderStageMask stageMask, const T& value, uint32_t offsetBytes = 0)

Updates the push constant values using the given pipeline layout.

Parameters
pipelineLayout The tp::PipelineLayout used to program the push constants.
stageMask The stages that will use the push constants in the updated range.
value The value that the push constants will be updated to. The size of the type determines the size of the updated range.
offsetBytes The offset to the start of the updated range in bytes.

void tp::CommandList::cmdPushConstants(const PipelineLayout& pipelineLayout, ShaderStageMask stageMask, const void* data, uint32_t sizeBytes, uint32_t offsetBytes = 0)

Updates the push constant values using the given pipeline layout.

Parameters
pipelineLayout The tp::PipelineLayout used to program the push constants.
stageMask The stages that will use the push constants in the updated range.
data Pointer to the data that the push constants will be updated to.
sizeBytes The size of the updated range in bytes.
offsetBytes The offset to the start of the updated range in bytes.