TgpuComputePass
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:53
A compute pass recording into a TgpuCommandEncoder.
Dispatch either by binding TypeGPU pipelines to it
(pipeline.with(pass).dispatchWorkgroups(...)), or proxy-style via
pass.setPipeline(pipeline) followed by pass.dispatchWorkgroups(...).
Call end() when done recording.
Properties
Section titled “Properties”[$internal]
Section titled “[$internal]”
readonly[$internal]:ComputePassInternals
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:54
resourceType
Section titled “resourceType”
readonlyresourceType:"compute-pass"
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:55
Methods
Section titled “Methods”dispatchWorkgroups()
Section titled “dispatchWorkgroups()”dispatchWorkgroups(
x,y?,z?):void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:68
Parameters
Section titled “Parameters”number
number
number
Returns
Section titled “Returns”void
dispatchWorkgroupsIndirect()
Section titled “dispatchWorkgroupsIndirect()”dispatchWorkgroupsIndirect<
T>(indirectBuffer,start?):void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:78
Dispatches compute workgroups using parameters read from a buffer.
The buffer must contain 3 consecutive u32 values (x, y, z workgroup counts).
To get the correct offset within complex data structures, use d.memoryLayoutOf(...).
Type Parameters
Section titled “Type Parameters”T extends AnyWgslData
Parameters
Section titled “Parameters”indirectBuffer
Section titled “indirectBuffer”Buffer marked with ‘indirect’ usage containing dispatch parameters or raw GPUBuffer
GPUBuffer | TgpuBuffer<T> & IndirectFlag
start?
Section titled “start?”PrimitiveOffsetInfo pointing to the first dispatch parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).
number | PrimitiveOffsetInfo
Returns
Section titled “Returns”void
end():
void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:84
Completes the recording of this compute pass
Returns
Section titled “Returns”void
setBindGroup()
Section titled “setBindGroup()”Call Signature
Section titled “Call Signature”setBindGroup(
bindGroup):void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:61
Associates a bind group with the layout it was created from
Parameters
Section titled “Parameters”bindGroup
Section titled “bindGroup”Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”setBindGroup<
Entries>(bindGroupLayout,bindGroup):void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:63
Associates a bind group with the given layout
Type Parameters
Section titled “Type Parameters”Entries
Section titled “Entries”Entries extends Record<string, TgpuLayoutEntry | null>
Parameters
Section titled “Parameters”bindGroupLayout
Section titled “bindGroupLayout”TgpuBindGroupLayout<Entries>
bindGroup
Section titled “bindGroup”GPUBindGroup | TgpuBindGroup<Entries>
Returns
Section titled “Returns”void
setPipeline()
Section titled “setPipeline()”setPipeline(
pipeline):void
Defined in: packages/typegpu/src/core/commandEncoder/computePass.ts:58
Sets the current TgpuComputePipeline for subsequent dispatches
Parameters
Section titled “Parameters”pipeline
Section titled “pipeline”Returns
Section titled “Returns”void