KDGpu::CommandBuffer¶
Module: Public API
#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 | |
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:
- RenderPassCommandRecorder for graphics/rendering commands (drawing, setting pipelines, bind groups, etc.)
- ComputePassCommandRecorder for compute shader dispatch commands
- RayTracingPassCommandRecorder for ray tracing commands
These recorders are obtained from CommandRecorder methods such as:
- CommandRecorder::beginRenderPass()
- CommandRecorder::beginComputePass()
- CommandRecorder::beginRayTracingPass()
Typical Workflow¶
- Create a CommandRecorder from a Device
- Begin a rendering pass with CommandRecorder::beginRenderPass(), beginComputePass(), or beginRayTracingPass()
- Record commands using the returned pass command recorder
- End the pass with the recorder's end() method
- Optionally record more passes or commands
- Call CommandRecorder::finish() to obtain the final CommandBuffer
- Submit the CommandBuffer to a Queue for execution
See also:¶
CommandRecorder, RenderPassCommandRecorder, ComputePassCommandRecorder, RayTracingPassCommandRecorder
Public Functions Documentation¶
function CommandBuffer¶
1 | |
function ~CommandBuffer¶
1 | |
function CommandBuffer¶
1 2 3 | |
function operator=¶
1 2 3 | |
function CommandBuffer¶
1 2 3 | |
function operator=¶
1 2 3 | |
function handle¶
1 | |
Returns the internal handle to the CommandBuffer.
Return: Handle
function isValid¶
1 | |
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 | |
Friends¶
friend CommandRecorder¶
1 2 3 | |
friend operator==¶
1 2 3 4 5 | |
Updated on 2026-03-31 at 00:02:06 +0000