Skip to content

TSdlGpuComputePass

A compute pass.

This handle is transient and should not be held or referenced after Finish is called.

Definition

Unit: Neslib.Sdl3.Gpu

type TSdlGpuComputePass = record ... end;

See Also

Operators

Name Description
Equal(TSdlGpuComputePass, TSdlGpuComputePass) Used to compare against another TSdlGpuComputePass.
Equal(TSdlGpuComputePass, Pointer) Used to compare against nil.
Implicit Used to set the value to nil.
NotEqual(TSdlGpuComputePass, TSdlGpuComputePass) Used to compare against another TSdlGpuComputePass.
NotEqual(TSdlGpuComputePass, Pointer) Used to compare against nil.

Methods

Name Description
BindPipeline Binds a compute pipeline on a command buffer for use in compute dispatch.
BindSamplers Binds texture-sampler pairs for use on the compute shader.
BindStorageBuffers Binds storage buffers as readonly for use on the compute pipeline.
BindStorageTextures Binds storage textures as readonly for use on the compute pipeline.
Dispatch(TSdlGpuBuffer, Integer) Dispatches compute work with parameters set from a buffer.
Dispatch(Integer, Integer, Integer) Dispatches compute work.
Finish Ends the current compute pass.

Operator Descriptions

Equal(TSdlGpuComputePass, TSdlGpuComputePass)

Used to compare against another TSdlGpuComputePass.

class operator Equal(const ALeft, ARight: TSdlGpuComputePass): Boolean; inline; static

Parameters

ALeft: TSdlGpuComputePass

ARight: TSdlGpuComputePass

Returns

Boolean


Equal(TSdlGpuComputePass, Pointer)

Used to compare against nil.

class operator Equal(const ALeft: TSdlGpuComputePass; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlGpuComputePass

ARight: Pointer

Returns

Boolean


Implicit(Pointer)

Used to set the value to nil.

class operator Implicit(const AValue: Pointer): TSdlGpuComputePass; inline; static

Parameters

AValue: Pointer

Returns

TSdlGpuComputePass


NotEqual(TSdlGpuComputePass, TSdlGpuComputePass)

Used to compare against another TSdlGpuComputePass.

class operator NotEqual(const ALeft, ARight: TSdlGpuComputePass): Boolean; inline; static

Parameters

ALeft: TSdlGpuComputePass

ARight: TSdlGpuComputePass

Returns

Boolean


NotEqual(TSdlGpuComputePass, Pointer)

Used to compare against nil.

class operator NotEqual(const ALeft: TSdlGpuComputePass; const ARight: Pointer): Boolean; inline; static

Parameters

ALeft: TSdlGpuComputePass

ARight: Pointer

Returns

Boolean


Method Descriptions

BindPipeline(TSdlGpuComputePipeline)

Binds a compute pipeline on a command buffer for use in compute dispatch.

procedure BindPipeline(const AComputePipeline: TSdlGpuComputePipeline); inline

Parameters

AComputePipeline: TSdlGpuComputePipeline : A compute pipeline to bind.


BindSamplers(Integer, TArray<TSdlGpuTextureSamplerBinding>)

Binds texture-sampler pairs for use on the compute shader.

The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.

Be sure your shader is set up according to the requirements documented TSdlGpuShader.

procedure BindSamplers(const AFirstSlot: Integer; const ATextureSamplerBindings: TArray<TSdlGpuTextureSamplerBinding>); inline

Parameters

AFirstSlot: Integer : The compute sampler slot to begin binding from.

ATextureSamplerBindings: TArray<TSdlGpuTextureSamplerBinding> : An array of texture-sampler binding record.

See Also


BindStorageBuffers(Integer, TArray<TSdlGpuBuffer>)

Binds storage buffers as readonly for use on the compute pipeline.

These buffers must have been created with TSdlGpuBufferUsage.ComputeStorageRead.

Be sure your shader is set up according to the requirements documented TSdlGpuShader.

procedure BindStorageBuffers(const AFirstSlot: Integer; const AStorageBuffers: TArray<TSdlGpuBuffer>); inline

Parameters

AFirstSlot: Integer : The compute storage buffer slot to begin binding from.

AStorageBuffers: TArray<TSdlGpuBuffer> : An array of storage buffer binding records.

See Also


BindStorageTextures(Integer, TArray<TSdlGpuTexture>)

Binds storage textures as readonly for use on the compute pipeline.

These textures must have been created with TSdlGpuTextureUsage.ComputeStorageRead.

Be sure your shader is set up according to the requirements documented TSdlGpuShader.

procedure BindStorageTextures(const AFirstSlot: Integer; const AStorageTextures: TArray<TSdlGpuTexture>); inline

Parameters

AFirstSlot: Integer : The compute storage texture slot to begin binding from.

AStorageTextures: TArray<TSdlGpuTexture> : An array of storage textures.

See Also


Dispatch(TSdlGpuBuffer, Integer)

Dispatches compute work with parameters set from a buffer.

The buffer layout should match the layout of TSdlGpuIndirectDispatchCommand. You must not call this method before binding a compute pipeline.

A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.

procedure Dispatch(const ABuffer: TSdlGpuBuffer; const AOffset: Integer); overload; inline

Parameters

ABuffer: TSdlGpuBuffer : A buffer containing dispatch parameters.

AOffset: Integer : The offset to start reading from the dispatch buffer.


Dispatch(Integer, Integer, Integer)

Dispatches compute work.

You must not call this method before binding a compute pipeline.

A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.

procedure Dispatch(const AGroupCountX, AGroupCountY, AGroupCountZ: Integer); overload; inline

Parameters

AGroupCountX: Integer : Number of local workgroups to dispatch in the X dimension.

AGroupCountY: Integer : Number of local workgroups to dispatch in the Y dimension.

AGroupCountZ: Integer : Number of local workgroups to dispatch in the Z dimension.


Finish

Ends the current compute pass.

All bound compute state on the command buffer is unset. The compute pass handle is now invalid.

procedure Finish; inline