Skip to content

TgpuComputePipeline

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:98

  • TgpuNamable.SelfResolvable.Timeable

readonly [$internal]: ComputePipelineInternals

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:99

SelfResolvable.[$internal]


readonly [$soul]: TgpuComputePipelineSoul

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:100


readonly resourceType: "compute-pipeline"

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:101

[$resolve](ctx): ResolvedSnippet

Defined in: packages/typegpu/src/types.ts:435

ResolutionCtx

ResolvedSnippet

SelfResolvable.[$resolve]


$name(label): this

Defined in: packages/typegpu/src/shared/meta.ts:44

string

this

TgpuNamable.$name


dispatchWorkgroups(x, y?, z?): void

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:144

number

number

number

void


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

T extends AnyWgslData

Buffer marked with ‘indirect’ usage containing dispatch parameters or raw GPUBuffer

GPUBuffer | TgpuBuffer<T> & IndirectFlag

PrimitiveOffsetInfo pointing to the first dispatch parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).

number | PrimitiveOffsetInfo

void


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.

Promise<void>


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.

void


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

T

(pipeline) => T

T


toString(): string

Defined in: packages/typegpu/src/types.ts:436

string

SelfResolvable.toString


with<Entries>(bindGroupLayout, bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:107

Entries extends Record<string, TgpuLayoutEntry | null>

TgpuBindGroupLayout<Entries>

TgpuBindGroup<Entries>

this

with(bindGroupLayout, bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:111

TgpuBindGroupLayout

GPUBindGroup

this

with(bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:112

TgpuBindGroup

this

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.

T extends AnyWgslData

TgpuImmediateVar<T>

ArrayBuffer | ArrayBufferView<ArrayBufferLike> | InferInput<T>

this

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

TgpuComputePass

this

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.

TgpuCommandEncoder

this

with(encoder): this

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:136

GPUCommandEncoder

this

with(pass): this

Defined in: packages/typegpu/src/core/pipeline/computePipeline.ts:137

GPUComputePassEncoder

this


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.

(start, end) => void | Promise<void>

this

Timeable.withPerformanceCallback


withTimestampWrites(options): this

Defined in: packages/typegpu/src/core/pipeline/timeable.ts:15

number

number

GPUQuerySet | TgpuQuerySet<"timestamp">

this

Timeable.withTimestampWrites

© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.