TgpuRenderPipeline
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:177
Extends
Section titled “Extends”TgpuNamable.SelfResolvable.Timeable
Type Parameters
Section titled “Type Parameters”Targets
Section titled “Targets”Targets = never
Properties
Section titled “Properties”[$internal]
Section titled “[$internal]”
readonly[$internal]:RenderPipelineInternals
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:179
Overrides
Section titled “Overrides”SelfResolvable.[$internal]
[$soul]
Section titled “[$soul]”
readonly[$soul]:TgpuRenderPipelineSoul
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:180
hasIndexBuffer
Section titled “hasIndexBuffer”
readonlyhasIndexBuffer:boolean
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:182
resourceType
Section titled “resourceType”
readonlyresourceType:"render-pipeline"
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:181
Methods
Section titled “Methods”[$resolve]()
Section titled “[$resolve]()”[$resolve](
ctx):ResolvedSnippet
Defined in: packages/typegpu/src/types.ts:435
Parameters
Section titled “Parameters”ResolutionCtx
Returns
Section titled “Returns”ResolvedSnippet
Inherited from
Section titled “Inherited from”SelfResolvable.[$resolve]
$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
draw()
Section titled “draw()”draw(
vertexCount,instanceCount?,firstVertex?,firstInstance?):void
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:260
Parameters
Section titled “Parameters”vertexCount
Section titled “vertexCount”number
instanceCount?
Section titled “instanceCount?”number
firstVertex?
Section titled “firstVertex?”number
firstInstance?
Section titled “firstInstance?”number
Returns
Section titled “Returns”void
drawIndexedIndirect()
Section titled “drawIndexedIndirect()”drawIndexedIndirect(
indirectBuffer,indirectOffset?):void
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:300
Draws indexed primitives using parameters read from a buffer.
The buffer must contain 5 consecutive 32-bit integer values (indexCount u32, instanceCount u32, firstIndex u32, baseVertex i32, firstInstance u32).
To get the correct offset within complex data structures, use d.memoryLayoutOf(...).
Parameters
Section titled “Parameters”indirectBuffer
Section titled “indirectBuffer”Buffer marked with ‘indirect’ usage containing draw parameters or raw GPUBuffer
GPUBuffer | TgpuBuffer<BaseData> & IndirectFlag
indirectOffset?
Section titled “indirectOffset?”PrimitiveOffsetInfo pointing to the first draw parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).
number | PrimitiveOffsetInfo
Returns
Section titled “Returns”void
drawIndirect()
Section titled “drawIndirect()”drawIndirect(
indirectBuffer,indirectOffset?):void
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:287
Draws primitives using parameters read from a buffer.
The buffer must contain 4 consecutive u32 values (vertexCount, instanceCount, firstVertex, firstInstance).
To get the correct offset within complex data structures, use d.memoryLayoutOf(...).
Parameters
Section titled “Parameters”indirectBuffer
Section titled “indirectBuffer”Buffer marked with ‘indirect’ usage containing draw parameters or raw GPUBuffer
GPUBuffer | TgpuBuffer<BaseData> & IndirectFlag
indirectOffset?
Section titled “indirectOffset?”PrimitiveOffsetInfo pointing to the first draw parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).
number | PrimitiveOffsetInfo
Returns
Section titled “Returns”void
initAsync()
Section titled “initAsync()”initAsync():
Promise<void>
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:271
Immediately resolves the pipeline, then awaits device.createRenderPipelineAsync().
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/pipeline/renderPipeline.ts:277
Immediately resolves the pipeline and creates WebGPU resources. NOTE: it is not necessary to initialize pipelines manually.
Returns
Section titled “Returns”void
pipe()
Section titled “pipe()”pipe<
T>(transform):T
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:228
Applies a transform to this pipeline, letting packages hand out reusable
configuration steps, e.g. pipeline.pipe(mesh.inject()).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”transform
Section titled “transform”(pipeline) => T
Returns
Section titled “Returns”T
toString()
Section titled “toString()”toString():
string
Defined in: packages/typegpu/src/types.ts:436
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”SelfResolvable.toString
with()
Section titled “with()”Call Signature
Section titled “Call Signature”with<
TData>(vertexLayout,buffer):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:184
Type Parameters
Section titled “Type Parameters”TData extends WgslArray<BaseData> | Disarray<BaseData>
Parameters
Section titled “Parameters”vertexLayout
Section titled “vertexLayout”TgpuVertexLayout<TData>
buffer
Section titled “buffer”GPUBuffer | TgpuBuffer<TData> & VertexFlag
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with<
Entries>(bindGroupLayout,bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:192
Type Parameters
Section titled “Type Parameters”Entries
Section titled “Entries”Entries extends Record<string, TgpuLayoutEntry | null>
Parameters
Section titled “Parameters”bindGroupLayout
Section titled “bindGroupLayout”TgpuBindGroupLayout<Entries>
bindGroup
Section titled “bindGroup”TgpuBindGroup<Entries>
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
bindGroupLayout,bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:196
Parameters
Section titled “Parameters”bindGroupLayout
Section titled “bindGroupLayout”bindGroup
Section titled “bindGroup”GPUBindGroup
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
bindGroup):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:197
Parameters
Section titled “Parameters”bindGroup
Section titled “bindGroup”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with<
T>(immediate,value):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:207
Provides a value for the given immediate variable, applied on draw 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.
Type Parameters
Section titled “Type Parameters”T extends AnyWgslData
Parameters
Section titled “Parameters”immediate
Section titled “immediate”ArrayBuffer | ArrayBufferView<ArrayBufferLike> | InferInput<T>
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
pass):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:215
Directs subsequent draw calls into the given render pass or render bundle encoder, letting multiple pipelines share one pass (and one submission).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
encoder):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:220
Directs subsequent draw calls into the given command encoder. Each draw records its own render pass; the caller owns the submission.
Parameters
Section titled “Parameters”encoder
Section titled “encoder”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
encoder):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:221
Parameters
Section titled “Parameters”encoder
Section titled “encoder”GPUCommandEncoder
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
pass):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:222
Parameters
Section titled “Parameters”GPURenderPassEncoder
Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
bundleEncoder):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:223
Parameters
Section titled “Parameters”bundleEncoder
Section titled “bundleEncoder”GPURenderBundleEncoder
Returns
Section titled “Returns”this
withColorAttachment()
Section titled “withColorAttachment()”withColorAttachment(
attachment):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:242
Attaches texture views to the pipeline’s targets (outputs).
Parameters
Section titled “Parameters”attachment
Section titled “attachment”FragmentOutToColorAttachment<Targets>
The object should match the shape returned by the fragment shader, with values matching the ColorAttachment type.
Returns
Section titled “Returns”this
Example
Section titled “Example”// Draw 3 vertices onto the context's canvaspipeline .withColorAttachment({ view: context }) .draw(3)withDepthStencilAttachment()
Section titled “withDepthStencilAttachment()”withDepthStencilAttachment(
attachment):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:244
Parameters
Section titled “Parameters”attachment
Section titled “attachment”Returns
Section titled “Returns”this
withIndexBuffer()
Section titled “withIndexBuffer()”Call Signature
Section titled “Call Signature”withIndexBuffer(
buffer,offsetElements?,sizeElements?):TgpuRenderPipeline<Targets> &HasIndexBuffer
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:248
Parameters
Section titled “Parameters”buffer
Section titled “buffer”TgpuBuffer<BaseData> & IndexFlag
offsetElements?
Section titled “offsetElements?”number
sizeElements?
Section titled “sizeElements?”number
Returns
Section titled “Returns”TgpuRenderPipeline<Targets> & HasIndexBuffer
Call Signature
Section titled “Call Signature”withIndexBuffer(
buffer,indexFormat,offsetBytes?,sizeBytes?):TgpuRenderPipeline<Targets> &HasIndexBuffer
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:253
Parameters
Section titled “Parameters”buffer
Section titled “buffer”GPUBuffer
indexFormat
Section titled “indexFormat”GPUIndexFormat
offsetBytes?
Section titled “offsetBytes?”number
sizeBytes?
Section titled “sizeBytes?”number
Returns
Section titled “Returns”TgpuRenderPipeline<Targets> & HasIndexBuffer
withPerformanceCallback()
Section titled “withPerformanceCallback()”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.
Parameters
Section titled “Parameters”callback
Section titled “callback”(start, end) => void | Promise<void>
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Timeable.withPerformanceCallback
withStencilReference()
Section titled “withStencilReference()”withStencilReference(
reference):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:246
Parameters
Section titled “Parameters”reference
Section titled “reference”number
Returns
Section titled “Returns”this
withTimestampWrites()
Section titled “withTimestampWrites()”withTimestampWrites(
options):this
Defined in: packages/typegpu/src/core/pipeline/timeable.ts:15
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”this
Inherited from
Section titled “Inherited from”Timeable.withTimestampWrites
© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.