A scoped compute pass for recording GPU compute dispatches.
More...
#include <ComputePass.h>
|
| void | bindPipeline (ComputePass *self, ComputePipeline *pipeline) |
| | Binds a compute pipeline for subsequent dispatches.
|
| |
| void | bindSamplers (const ComputePass *self, Uint32 firstSlot, const SDL_GPUTextureSamplerBinding *bindings, Uint32 num) |
| | Binds texture-sampler pairs for the compute stage.
|
| |
| void | bindStorageBuffers (const ComputePass *self, Uint32 firstSlot, SDL_GPUBuffer *const *buffers, Uint32 num) |
| | Binds read-only storage buffers for the compute stage.
|
| |
| void | bindStorageTextures (const ComputePass *self, Uint32 firstSlot, SDL_GPUTexture *const *textures, Uint32 num) |
| | Binds read-only storage textures for the compute stage.
|
| |
| void | dispatchCompute (const ComputePass *self, Uint32 groupCountX, Uint32 groupCountY, Uint32 groupCountZ) |
| | Dispatches a compute workload.
|
| |
| void | dispatchComputeIndirect (const ComputePass *self, SDL_GPUBuffer *buffer, Uint32 offset) |
| | Dispatches a compute workload with parameters sourced from a GPU buffer.
|
| |
| ComputePass * | init (ComputePass *self, CommandBuffer *commands, SDL_GPUComputePass *pass) |
| | Initializes this ComputePass wrapping the given SDL compute pass.
|
| |
| Class * | _ComputePass (void) |
| | The ComputePass archetype.
|
| |
|
| ComputePassInterface * | interface |
| | The interface.
|
| |
A scoped compute pass for recording GPU compute dispatches.
Obtain a ComputePass from CommandBuffer::beginComputePass. When all dispatches have been recorded, release the pass — dealloc calls SDL_EndGPUComputePass automatically so no explicit end is required:
release(compute);
static ComputePass * beginComputePass(CommandBuffer *self, const SDL_GPUStorageTextureReadWriteBinding *storageTextures, Uint32 numStorageTextures, const SDL_GPUStorageBufferReadWriteBinding *storageBuffers, Uint32 numStorageBuffers)
Definition CommandBuffer.c:78
A scoped compute pass for recording GPU compute dispatches.
Definition ComputePass.h:56
ComputePipeline * pipeline
The currently bound pipeline, or NULL.
Definition ComputePass.h:85
void dispatchCompute(const ComputePass *self, Uint32 groupCountX, Uint32 groupCountY, Uint32 groupCountZ)
Dispatches a compute workload.
Definition ComputePass.c:94
void bindPipeline(ComputePass *self, ComputePipeline *pipeline)
Binds a compute pipeline for subsequent dispatches.
Definition ComputePass.c:57
◆ _ComputePass()
| Class * _ComputePass |
( |
void |
| ) |
|
◆ bindPipeline()
Binds a compute pipeline for subsequent dispatches.
◆ bindSamplers()
| void bindSamplers |
( |
const ComputePass * |
self, |
|
|
Uint32 |
firstSlot, |
|
|
const SDL_GPUTextureSamplerBinding * |
bindings, |
|
|
Uint32 |
num |
|
) |
| |
Binds texture-sampler pairs for the compute stage.
◆ bindStorageBuffers()
| void bindStorageBuffers |
( |
const ComputePass * |
self, |
|
|
Uint32 |
firstSlot, |
|
|
SDL_GPUBuffer *const * |
buffers, |
|
|
Uint32 |
num |
|
) |
| |
Binds read-only storage buffers for the compute stage.
◆ bindStorageTextures()
| void bindStorageTextures |
( |
const ComputePass * |
self, |
|
|
Uint32 |
firstSlot, |
|
|
SDL_GPUTexture *const * |
textures, |
|
|
Uint32 |
num |
|
) |
| |
Binds read-only storage textures for the compute stage.
◆ dispatchCompute()
| void dispatchCompute |
( |
const ComputePass * |
self, |
|
|
Uint32 |
groupCountX, |
|
|
Uint32 |
groupCountY, |
|
|
Uint32 |
groupCountZ |
|
) |
| |
Dispatches a compute workload.
- Parameters
-
| self | The ComputePass. |
| groupCountX | Number of workgroups in the X dimension. |
| groupCountY | Number of workgroups in the Y dimension. |
| groupCountZ | Number of workgroups in the Z dimension. |
◆ dispatchComputeIndirect()
| void dispatchComputeIndirect |
( |
const ComputePass * |
self, |
|
|
SDL_GPUBuffer * |
buffer, |
|
|
Uint32 |
offset |
|
) |
| |
Dispatches a compute workload with parameters sourced from a GPU buffer.
◆ init()
Initializes this ComputePass wrapping the given SDL compute pass.
- Parameters
-
| self | The ComputePass. |
| commands | The CommandBuffer that created this pass. |
| pass | The SDL compute pass to wrap. Must not be NULL. |
- Returns
- The initialized ComputePass, or NULL on failure.
◆ data
◆ interface
| ComputePassInterface* ComputePass::interface |
|
protected |
◆ object
| Object ComputePass::object |
◆ pipeline
The currently bound pipeline, or NULL.
The documentation for this struct was generated from the following files: