Skip to main content
An active render pass. Issue all draw calls before calling finish().

Methods

setPipeline

Bind a pipeline for subsequent draw calls.

setVertexBuffer

Bind a vertex buffer to slot (0-based).

setIndexBuffer

Bind an index buffer. format defaults to ‘uint16’.

setBindGroup

Bind a pre-created BindGroup to a group slot. dynamicOffsets: one byte offset per dynamic UBO in this group (dynamic UBOs are declared on the pipeline via BindGroupLayoutEntry.hasDynamicOffset). Order matches the UBOs’ appearance in BindGroupDesc.ubos. Typical 3D pattern: shared texture BindGroup at group 1, per-object UBO dynamic offset at group 0.

setViewport

Set the render viewport in pixels. Origin is top-left on all backends except GL (bottom-left).

setScissorRect

Set the scissor rectangle in pixels.

setStencilReference

Set the stencil reference value.

setBlendColor

Set the constant blend color for ‘constant’ / ‘one-minus-constant’ factors.

draw

Non-indexed draw. instanceCount defaults to 1, firstVertex to 0.

drawIndexed

Indexed draw. instanceCount defaults to 1, firstIndex to 0.

finish

Submit the pass. Any further method calls on this object will error.