Skip to content

KDGpu::CommandBuffer

Module: Public API

CommandBuffer. More...

#include <KDGpu/command_buffer.h>

Public Functions

Name
CommandBuffer()
~CommandBuffer()
CommandBuffer(CommandBuffer && other)
CommandBuffer & operator=(CommandBuffer && other)
CommandBuffer(const CommandBuffer & ) =delete
CommandBuffer & operator=(const CommandBuffer & ) =delete
const Handle< CommandBuffer_t > & handle() const
Returns the internal handle to the CommandBuffer.
bool isValid() const
Checks if the CommandBuffer is valid and can be used.
operator Handle< CommandBuffer_t >() const

Friends

Name
class CommandRecorder
KDGPU_EXPORT bool operator==(const CommandBuffer & a, const CommandBuffer & b)

Detailed Description

1
class KDGpu::CommandBuffer;

CommandBuffer.

Note: CommandBuffer instances cannot be created directly by the user. They are only obtained as the result of calling CommandRecorder::finish() after recording commands.

A CommandBuffer is a pre-recorded sequence of GPU commands that can be submitted to a Queue for execution.

Recording Commands

Commands are recorded into a CommandBuffer using specialized command recorders:

These recorders are obtained from CommandRecorder methods such as:

Typical Workflow

  1. Create a CommandRecorder from a Device
  2. Begin a rendering pass with CommandRecorder::beginRenderPass(), beginComputePass(), or beginRayTracingPass()
  3. Record commands using the returned pass command recorder
  4. End the pass with the recorder's end() method
  5. Optionally record more passes or commands
  6. Call CommandRecorder::finish() to obtain the final CommandBuffer
  7. Submit the CommandBuffer to a Queue for execution

See also:

CommandRecorder, RenderPassCommandRecorder, ComputePassCommandRecorder, RayTracingPassCommandRecorder

Public Functions Documentation

function CommandBuffer

1
CommandBuffer()

function ~CommandBuffer

1
~CommandBuffer()

function CommandBuffer

1
2
3
CommandBuffer(
    CommandBuffer && other
)

function operator=

1
2
3
CommandBuffer & operator=(
    CommandBuffer && other
)

function CommandBuffer

1
2
3
CommandBuffer(
    const CommandBuffer & 
) =delete

function operator=

1
2
3
CommandBuffer & operator=(
    const CommandBuffer & 
) =delete

function handle

1
inline const Handle< CommandBuffer_t > & handle() const

Returns the internal handle to the CommandBuffer.

Return: Handle

function isValid

1
inline bool isValid() const

Checks if the CommandBuffer is valid and can be used.

Return: true if the CommandBuffer is valid, false otherwise

function operator Handle< CommandBuffer_t >

1
inline operator Handle< CommandBuffer_t >() const

Friends

friend CommandRecorder

1
2
3
friend class CommandRecorder(
    CommandRecorder 
);

friend operator==

1
2
3
4
5
friend KDGPU_EXPORT bool operator==(
    const CommandBuffer & a,

    const CommandBuffer & b
);

Updated on 2026-03-31 at 00:02:06 +0000