TgpuCommandEncoder
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:51
The TypeGPU equivalent of GPUCommandEncoder, for batching multiple passes (and draws within them) into a single submission.
Example
Section titled “Example”const encoder = root.createCommandEncoder();const pass = encoder.beginRenderPass({ colorAttachments: [{ view: msaaTexture, resolveTarget: context }],});scenePipeline.with(pass).draw(vertexCount);skyPipeline.with(pass).draw(3);pass.end();encoder.submit();For anything not covered by the typed surface (e.g. texture copies), grab
the raw encoder via root.unwrap(encoder).
Extends
Section titled “Extends”TgpuNamable
Properties
Section titled “Properties”[$internal]
Section titled “[$internal]”
readonly[$internal]:CommandEncoderInternals
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:52
resourceType
Section titled “resourceType”
readonlyresourceType:"command-encoder"
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:53
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
beginComputePass()
Section titled “beginComputePass()”beginComputePass(
descriptor?):TgpuComputePass
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:62
Begins recording a compute pass
Parameters
Section titled “Parameters”descriptor?
Section titled “descriptor?”Returns
Section titled “Returns”beginRenderPass()
Section titled “beginRenderPass()”beginRenderPass(
descriptor):TgpuRenderPass
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:59
Begins recording a render pass. Attachment views accept TypeGPU textures, texture views and canvas contexts, next to raw GPUTextureViews.
Parameters
Section titled “Parameters”descriptor
Section titled “descriptor”Returns
Section titled “Returns”finish()
Section titled “finish()”finish(
descriptor?):GPUCommandBuffer
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:71
Escape hatch: finishes the recording without submitting, for manual
multi-encoder batching via device.queue.submit([...]).
Parameters
Section titled “Parameters”descriptor?
Section titled “descriptor?”GPUCommandBufferDescriptor
Returns
Section titled “Returns”GPUCommandBuffer
submit()
Section titled “submit()”submit():
void
Defined in: packages/typegpu/src/core/commandEncoder/commandEncoder.ts:65
Finishes the recording and submits the resulting command buffer to the device queue
Returns
Section titled “Returns”void
© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.