Skip to content

TgpuComputePipeline

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

  • TgpuNamable.SelfResolvable.Timeable

readonly [$internal]: ComputePipelineInternals

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

SelfResolvable.[$internal]


readonly [$soul]: TgpuComputePipelineSoul

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


readonly resourceType: "compute-pipeline"

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

[$resolve](ctx): ResolvedSnippet

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

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:116

number

number

number

void


dispatchWorkgroupsIndirect<T>(indirectBuffer, start?): void

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

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:122

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:128

Immediately resolves the pipeline and creates WebGPU resources. NOTE: it is not necessary to initialize pipelines manually.

void


toString(): string

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

string

SelfResolvable.toString


with<Entries>(bindGroupLayout, bindGroup): this

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

Entries extends Record<string, TgpuLayoutEntry | null>

TgpuBindGroupLayout<Entries>

TgpuBindGroup<Entries>

this

with(bindGroupLayout, bindGroup): this

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

TgpuBindGroupLayout

GPUBindGroup

this

with(bindGroup): this

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

TgpuBindGroup

this

with(pass): this

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

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:112

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:113

GPUCommandEncoder

this

with(pass): this

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

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