TgpuRenderPipeline
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:132
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:134
Overrides
Section titled “Overrides”SelfResolvable.[$internal]
hasIndexBuffer
Section titled “hasIndexBuffer”
readonlyhasIndexBuffer:boolean
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:136
resourceType
Section titled “resourceType”
readonlyresourceType:"render-pipeline"
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:135
Methods
Section titled “Methods”[$resolve]()
Section titled “[$resolve]()”[$resolve](
ctx):ResolvedSnippet
Defined in: packages/typegpu/src/types.ts:338
Parameters
Section titled “Parameters”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:97
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:186
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:214
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:201
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
toString()
Section titled “toString()”toString():
string
Defined in: packages/typegpu/src/types.ts:339
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:138
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:146
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:150
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:151
Parameters
Section titled “Parameters”bindGroup
Section titled “bindGroup”Returns
Section titled “Returns”this
Call Signature
Section titled “Call Signature”with(
encoder):this
Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:152
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:153
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:154
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:168
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:170
Parameters
Section titled “Parameters”attachment
Section titled “attachment”DepthStencilAttachment
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:174
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:179
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:6
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:172
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:8
Parameters
Section titled “Parameters”options
Section titled “options”beginningOfPassWriteIndex?
Section titled “beginningOfPassWriteIndex?”number
endOfPassWriteIndex?
Section titled “endOfPassWriteIndex?”number
querySet
Section titled “querySet”TgpuQuerySet<"timestamp"> | GPUQuerySet
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”Timeable.withTimestampWrites