Skip to content

TgpuGuardedComputePipeline

TArgs extends number[] = number[]

pipeline: TgpuComputePipeline

The underlying pipeline used during dispatchThreads.

packages/typegpu/src/core/root/rootTypes.ts:102


sizeUniform: TgpuUniform<Vec3u>

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.

packages/typegpu/src/core/root/rootTypes.ts:108

dispatchThreads(…args): void

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

packages/typegpu/src/core/root/rootTypes.ts:97


with(bindGroup): TgpuGuardedComputePipeline<TArgs>

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

TgpuBindGroup

TgpuGuardedComputePipeline<TArgs>

packages/typegpu/src/core/root/rootTypes.ts:87