SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::GPUCommandBuffer Class Reference

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...
 
GPUFenceSubmitAndAcquireFence ()
 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...
 

Detailed Description

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.

Since
This struct is available since SDL 3.2.0.
See also
GPUDevice.AcquireCommandBuffer
GPUCommandBuffer.Submit
GPUCommandBuffer.SubmitAndAcquireFence

Constructor & Destructor Documentation

◆ GPUCommandBuffer()

constexpr SDL::GPUCommandBuffer::GPUCommandBuffer ( GPUCommandBufferRaw  gPUCommandBuffer = {})
inlineconstexpr
Parameters
gPUCommandBufferthe value to be wrapped

Member Function Documentation

◆ operator GPUCommandBufferRaw()

constexpr SDL::GPUCommandBuffer::operator GPUCommandBufferRaw ( ) const
inlineconstexpr
Returns
the underlying GPUCommandBufferRaw.

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