TgpuGuardedComputePipeline
Defined in: packages/typegpu/src/core/root/rootTypes.ts:71
Extends
Section titled “Extends”TgpuNamable
Type Parameters
Section titled “Type Parameters”TArgs extends number[] = number[]
Properties
Section titled “Properties”[$soul]
Section titled “[$soul]”
readonly[$soul]:TgpuGuardedComputePipelineSoul
Defined in: packages/typegpu/src/core/root/rootTypes.ts:73
pipeline
Section titled “pipeline”pipeline:
TgpuComputePipeline
Defined in: packages/typegpu/src/core/root/rootTypes.ts:123
The underlying pipeline used during dispatchThreads.
resourceType
Section titled “resourceType”
readonlyresourceType:"guarded-compute-pipeline"
Defined in: packages/typegpu/src/core/root/rootTypes.ts:72
sizeUniform
Section titled “sizeUniform”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.
Methods
Section titled “Methods”$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
dispatchThreads()
Section titled “dispatchThreads()”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.
Parameters
Section titled “Parameters”…TArgs
Returns
Section titled “Returns”void
initAsync()
Section titled “initAsync()”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.
Returns
Section titled “Returns”Promise<void>
initSync()
Section titled “initSync()”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.
Returns
Section titled “Returns”void
with()
Section titled “with()”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).
Parameters
Section titled “Parameters”bindGroup
Section titled “bindGroup”Returns
Section titled “Returns”TgpuGuardedComputePipeline<TArgs>
withPerformanceCallback()
Section titled “withPerformanceCallback()”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).
Parameters
Section titled “Parameters”callback
Section titled “callback”(start, end) => void | Promise<void>
Returns
Section titled “Returns”TgpuGuardedComputePipeline<TArgs>
withTimestampWrites()
Section titled “withTimestampWrites()”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).
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”TgpuGuardedComputePipeline<TArgs>