TgpuComputePipeline
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:98
Extends
Section titled “Extends”TgpuNamable.SelfResolvable.Timeable
Properties
Section titled “Properties”[$internal]
Section titled “[$internal]”
readonly[$internal]:ComputePipelineInternals
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:99
Overrides
Section titled “Overrides”SelfResolvable.[$internal]
[$soul]
Section titled “[$soul]”
readonly[$soul]:TgpuComputePipelineSoul
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:100
resourceType
Section titled “resourceType”
readonlyresourceType:"compute-pipeline"
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:101
Methods
Section titled “Methods”[$resolve]()
Section titled “[$resolve]()”[$resolve](
ctx):ResolvedSnippet
Defined in: packages/typegpu/src/types.ts:435
Parameters
Section titled “Parameters”ResolutionCtx
Returns
Section titled “Returns”ResolvedSnippet
Inherited from
Section titled “Inherited from”SelfResolvable.[$resolve]
$name()
Section titled “$name()”$name(
label):this
Defined in: packages/typegpu/src/shared/meta.ts:44
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”TgpuNamable.$name
dispatchWorkgroups()
Section titled “dispatchWorkgroups()”dispatchWorkgroups(
x,y?,z?):void
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:144
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/pipeline/computePipeline.ts:166
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
initAsync()
Section titled “initAsync()”initAsync():
Promise<void>
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:150
Immediately resolves the pipeline, then awaits device.createComputePipelineAsync().
NOTE: it is not necessary to initialize pipelines manually.
Returns
Section titled “Returns”Promise<void>
initSync()
Section titled “initSync()”initSync():
void
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:156
Immediately resolves the pipeline and creates WebGPU resources. NOTE: it is not necessary to initialize pipelines manually.
Returns
Section titled “Returns”void
pipe()
Section titled “pipe()”pipe<
T>(transform):T
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:142
Applies a transform to this pipeline, letting packages hand out reusable
configuration steps, e.g. pipeline.pipe(cache.inject()).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”transform
Section titled “transform”(pipeline) => T
Returns
Section titled “Returns”T
toString()
Section titled “toString()”toString():
string
Defined in: packages/typegpu/src/types.ts:436
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”SelfResolvable.toString
with()
Section titled “with()”Call Signature
Section titled “Call Signature”with<
Entries>(bindGroupLayout,bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:107
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”TgpuBindGroup<Entries>
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
bindGroupLayout,bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:111
Parameters
Section titled “Parameters”bindGroupLayout
Section titled “bindGroupLayout”bindGroup
Section titled “bindGroup”GPUBindGroup
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:112
Parameters
Section titled “Parameters”bindGroup
Section titled “bindGroup”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with<
T>(immediate,value):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:122
Provides a value for the given immediate variable, applied on dispatch
like the rest of the pipeline-held state and overridden by
pass.setImmediates. The value is captured (copied) at call time;
mutating it afterwards has no effect.
Passing an ArrayBuffer or typed array skips serialization entirely; the bytes
are copied verbatim and the caller guarantees they match the schema’s layout.
Type Parameters
Section titled “Type Parameters”T extends AnyWgslData
Parameters
Section titled “Parameters”immediate
Section titled “immediate”ArrayBuffer | ArrayBufferView<ArrayBufferLike> | InferInput<T>
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
pass):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:130
Directs subsequent dispatches into the given compute pass, letting multiple pipelines share one pass (and one submission).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
encoder):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:135
Directs subsequent dispatches into the given command encoder. Each dispatch records its own compute pass; the caller owns the submission.
Parameters
Section titled “Parameters”encoder
Section titled “encoder”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
encoder):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:136
Parameters
Section titled “Parameters”encoder
Section titled “encoder”GPUCommandEncoder
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
pass):this
Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:137
Parameters
Section titled “Parameters”GPUComputePassEncoder
Returns
Section titled “Returns”this
withPerformanceCallback()
Section titled “withPerformanceCallback()”withPerformanceCallback(
callback):this
Defined in: packages/typegpu/src/core/pipeline/timeable.ts:13
Attaches a callback reporting the GPU-side start and end timestamps of the pipeline’s pass. Repeated executions within one command encoder write to the same query set indices, so the callback fires once, with the timestamps of the last execution.
Parameters
Section titled “Parameters”callback
Section titled “callback”(start, end) => void | Promise<void>
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Timeable.withPerformanceCallback
withTimestampWrites()
Section titled “withTimestampWrites()”withTimestampWrites(
options):this
Defined in: packages/typegpu/src/core/pipeline/timeable.ts:15
Parameters
Section titled “Parameters”options
Section titled “options”beginningOfPassWriteIndex?
Section titled “beginningOfPassWriteIndex?”number
endOfPassWriteIndex?
Section titled “endOfPassWriteIndex?”number
querySet
Section titled “querySet”GPUQuerySet | TgpuQuerySet<"timestamp">
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Timeable.withTimestampWrites
© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.