Skip to content

TgpuRenderPipeline

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:166

  • TgpuNamable.SelfResolvable.Timeable

Targets = never

readonly [$internal]: RenderPipelineInternals

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:168

SelfResolvable.[$internal]


readonly [$soul]: TgpuRenderPipelineSoul

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:169


readonly hasIndexBuffer: boolean

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:171


readonly resourceType: "render-pipeline"

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:170

[$resolve](ctx): ResolvedSnippet

Defined in: packages/typegpu/src/types.ts:426

ResolutionCtx

ResolvedSnippet

SelfResolvable.[$resolve]


$name(label): this

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

string

this

TgpuNamable.$name


draw(vertexCount, instanceCount?, firstVertex?, firstInstance?): void

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:231

number

number

number

number

void


drawIndexedIndirect(indirectBuffer, indirectOffset?): void

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:271

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(...).

Buffer marked with ‘indirect’ usage containing draw parameters or raw GPUBuffer

GPUBuffer | TgpuBuffer<BaseData> & IndirectFlag

PrimitiveOffsetInfo pointing to the first draw parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).

number | PrimitiveOffsetInfo

void


drawIndirect(indirectBuffer, indirectOffset?): void

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:258

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(...).

Buffer marked with ‘indirect’ usage containing draw parameters or raw GPUBuffer

GPUBuffer | TgpuBuffer<BaseData> & IndirectFlag

PrimitiveOffsetInfo pointing to the first draw parameter. If not provided, starts at offset 0. To obtain safe offsets, use d.memoryLayoutOf(...).

number | PrimitiveOffsetInfo

void


initAsync(): Promise<void>

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:242

Immediately resolves the pipeline, then awaits device.createRenderPipelineAsync(). NOTE: it is not necessary to initialize pipelines manually.

Promise<void>


initSync(): void

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:248

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

void


toString(): string

Defined in: packages/typegpu/src/types.ts:427

string

SelfResolvable.toString


with<TData>(vertexLayout, buffer): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:173

TData extends WgslArray<BaseData> | Disarray<BaseData>

TgpuVertexLayout<TData>

GPUBuffer | TgpuBuffer<TData> & VertexFlag

this

with<Entries>(bindGroupLayout, bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:181

Entries extends Record<string, TgpuLayoutEntry | null>

TgpuBindGroupLayout<Entries>

TgpuBindGroup<Entries>

this

with(bindGroupLayout, bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:185

TgpuBindGroupLayout

GPUBindGroup

this

with(bindGroup): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:186

TgpuBindGroup

this

with(pass): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:191

Directs subsequent draw calls into the given render pass or render bundle encoder, letting multiple pipelines share one pass (and one submission).

TgpuRenderCommands

this

with(encoder): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:196

Directs subsequent draw calls into the given command encoder. Each draw records its own render pass; the caller owns the submission.

TgpuCommandEncoder

this

with(encoder): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:197

GPUCommandEncoder

this

with(pass): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:198

GPURenderPassEncoder

this

with(bundleEncoder): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:199

GPURenderBundleEncoder

this


withColorAttachment(attachment): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:213

Attaches texture views to the pipeline’s targets (outputs).

FragmentOutToColorAttachment<Targets>

The object should match the shape returned by the fragment shader, with values matching the ColorAttachment type.

this

// Draw 3 vertices onto the context's canvas
pipeline
.withColorAttachment({ view: context })
.draw(3)

withDepthStencilAttachment(attachment): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:215

DepthStencilAttachment

this


withIndexBuffer(buffer, offsetElements?, sizeElements?): TgpuRenderPipeline<Targets> & HasIndexBuffer

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:219

TgpuBuffer<BaseData> & IndexFlag

number

number

TgpuRenderPipeline<Targets> & HasIndexBuffer

withIndexBuffer(buffer, indexFormat, offsetBytes?, sizeBytes?): TgpuRenderPipeline<Targets> & HasIndexBuffer

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:224

GPUBuffer

GPUIndexFormat

number

number

TgpuRenderPipeline<Targets> & HasIndexBuffer


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.

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

this

Timeable.withPerformanceCallback


withStencilReference(reference): this

Defined in: packages/typegpu/src/core/pipeline/renderPipeline.ts:217

number

this


withTimestampWrites(options): this

Defined in: packages/typegpu/src/core/pipeline/timeable.ts:15

number

number

GPUQuerySet | TgpuQuerySet<"timestamp">

this

Timeable.withTimestampWrites