SDL3pp
A slim C++ wrapper for SDL3
|
An opaque handle representing a command buffer. More...
Public Member Functions | |
constexpr | GPUCommandBuffer (GPUCommandBufferRaw gPUCommandBuffer={}) |
Wraps GPUCommandBuffer. More... | |
constexpr bool | operator== (const GPUCommandBuffer &other) const =default |
Default comparison operator. | |
constexpr bool | operator== (GPUCommandBufferRaw gPUCommandBuffer) const |
Compares with the underlying type. | |
constexpr | operator GPUCommandBufferRaw () const |
Unwraps to the underlying GPUCommandBuffer. More... | |
void | InsertDebugLabel (StringParam text) |
Inserts an arbitrary string label into the command buffer callstream. More... | |
void | PushDebugGroup (StringParam name) |
Begins a debug group with an arbitrary name. More... | |
void | PopDebugGroup () |
Ends the most-recently pushed debug group. More... | |
void | PushVertexUniformData (Uint32 slot_index, SourceBytes data) |
Pushes data to a vertex uniform slot on the command buffer. More... | |
void | PushFragmentUniformData (Uint32 slot_index, SourceBytes data) |
Pushes data to a fragment uniform slot on the command buffer. More... | |
void | PushComputeUniformData (Uint32 slot_index, SourceBytes data) |
Pushes data to a uniform slot on the command buffer. More... | |
GPURenderPass | BeginRenderPass (std::span< const GPUColorTargetInfo > color_target_infos, OptionalRef< const GPUDepthStencilTargetInfo > depth_stencil_target_info) |
Begins a render pass on a command buffer. More... | |
GPUComputePass | BeginComputePass (std::span< const GPUStorageTextureReadWriteBinding > storage_texture_bindings, std::span< const GPUStorageBufferReadWriteBinding > storage_buffer_bindings) |
Begins a compute pass on a command buffer. More... | |
GPUCopyPass | BeginCopyPass () |
Begins a copy pass on a command buffer. More... | |
void | GenerateMipmapsForTexture (GPUTexture texture) |
Generates mipmaps for the given texture. More... | |
void | BlitTexture (const GPUBlitInfo &info) |
Blits from a source texture region to a destination texture region. More... | |
GPUTexture | AcquireSwapchainTexture (WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr) |
Acquire a texture to use in presentation. More... | |
GPUTexture | WaitAndAcquireSwapchainTexture (WindowParam window, Uint32 *swapchain_texture_width=nullptr, Uint32 *swapchain_texture_height=nullptr) |
Blocks the thread until a swapchain texture is available to be acquired, and then acquires it. More... | |
void | Submit () |
Submits a command buffer so its commands can be processed on the GPU. More... | |
GPUFence * | SubmitAndAcquireFence () |
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated with the command buffer. More... | |
void | Cancel () |
Cancels a command buffer. More... | |
Most state is managed via command buffers. When setting state using a command buffer, that state is local to the command buffer.
Commands only begin execution on the GPU once GPUCommandBuffer.Submit is called. Once the command buffer is submitted, it is no longer valid to use it.
Command buffers are executed in submission order. If you submit command buffer A and then command buffer B all commands in A will begin executing before any command in B begins executing.
In multi-threading scenarios, you should only access a command buffer on the thread you acquired it from.
|
inlineconstexpr |
gPUCommandBuffer | the value to be wrapped |
|
inlineconstexpr |