AdvancedThe active command target that draws and state are recorded into. This is the live render pass during normal rendering, or a GPURenderBundleEncoder while a render bundle is being recorded (see beginBundle). Both encoders expose the same render/bind command API the encoder relies on (GPURenderCommandsMixin + GPUBindingCommandsMixin), so callers write to it without caring which one is active. Pass-level commands (viewport, stencil, executeBundles, end) are not part of that shared API and go through _passEncoder.
Begins recording a render bundle. While recording, all draw commands are captured into a GPURenderBundleEncoder instead of the active render pass. The current render pass encoder is saved and restored when endBundle is called.
Render bundles allow pre-recording of draw commands that can be replayed multiple times via executeBundle, reducing CPU overhead for repeated draw sequences.
Generic destroy methods to be overridden by the subclass
Sets up the pipeline, geometry, and bind groups then issues an indirect draw call.
Uses drawIndexedIndirect when the geometry has an index buffer, otherwise drawIndirect.
Draw parameters (vertex count, instance count, etc.) are read from the indirect buffer on the GPU.
The draw options.
The geometry to draw.
The GPU buffer containing the indirect draw parameters.
Byte offset into the indirect buffer.
The shader to use.
OptionalskipSync?: booleanIf true, skips syncing uniform groups to their GPU buffers.
Optionalstate?: StateOptional render state (blending, depth, etc.).
Optionaltopology?: TopologyOptional primitive topology override.
Finishes recording the current render bundle and restores the previous render pass encoder.
The recorded GPURenderBundle ready to be executed via executeBundle.
Replays a previously recorded render bundle on the current render pass. The bound state cache is cleared since the bundle may set its own pipeline, bind groups, and buffers.
The render bundle to execute.
Optionaltopology: TopologyOptionaloverrides: ShaderOverridesSets the stencil reference value for subsequent draws. This is a pass-level command, so it always targets the real render pass — not a bundle encoder, which cannot set stencil state.
The stencil reference value to use.
The system that handles encoding commands for the GPU.