Skip to content

TgpuGuardedComputePipeline

Defined in: packages/typegpu/src/core/root/rootTypes.ts:71

  • TgpuNamable

TArgs extends number[] = number[]

readonly [$soul]: TgpuGuardedComputePipelineSoul

Defined in: packages/typegpu/src/core/root/rootTypes.ts:73


pipeline: TgpuComputePipeline

Defined in: packages/typegpu/src/core/root/rootTypes.ts:123

The underlying pipeline used during dispatchThreads.


readonly resourceType: "guarded-compute-pipeline"

Defined in: packages/typegpu/src/core/root/rootTypes.ts:72


sizeUniform: TgpuUniform<Vec3u>

Defined in: packages/typegpu/src/core/root/rootTypes.ts:129

The buffer used to automatically pass the thread count to the underlying pipeline during dispatchThreads. For pipelines with a dimension count lower than 3, the remaining coordinates are expected to be 1.

$name(label): this

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

string

this

TgpuNamable.$name


dispatchThreads(…args): void

Defined in: packages/typegpu/src/core/root/rootTypes.ts:106

Dispatches the pipeline. Unlike TgpuComputePipeline.dispatchWorkgroups(), this method takes in the number of threads to run in each dimension.

Under the hood, the number of expected threads is sent as a uniform, and “guarded” by a bounds check.

TArgs

void


initAsync(): Promise<void>

Defined in: packages/typegpu/src/core/root/rootTypes.ts:112

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/root/rootTypes.ts:118

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

void


with(bindGroup): TgpuGuardedComputePipeline<TArgs>

Defined in: packages/typegpu/src/core/root/rootTypes.ts:78

Returns a pipeline wrapper with the specified bind group bound. Analogous to TgpuComputePipeline.with(bindGroup).

TgpuBindGroup

TgpuGuardedComputePipeline<TArgs>


withPerformanceCallback(callback): TgpuGuardedComputePipeline<TArgs>

Defined in: packages/typegpu/src/core/root/rootTypes.ts:84

Returns a pipeline wrapper with the given performance callback attached. Analogous to TgpuComputePipeline.withPerformanceCallback(callback).

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

TgpuGuardedComputePipeline<TArgs>


withTimestampWrites(options): TgpuGuardedComputePipeline<TArgs>

Defined in: packages/typegpu/src/core/root/rootTypes.ts:92

Returns a pipeline wrapper with the given timestamp writes configuration. Analogous to TgpuComputePipeline.withTimestampWrites(options).

number

number

GPUQuerySet | TgpuQuerySet<"timestamp">

TgpuGuardedComputePipeline<TArgs>