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.
Optionallabel: stringOptional debug label. Names the bundle in GPU captures and in the WebGPU
validation errors it can raise when replayed, instead of (unlabeled).
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 RenderBundle, ready to be executed via executeBundle and stamped with the pipeline state it baked so isBundleValid can vet it on later frames.
Replays previously recorded render bundles on the current render pass. The bound state cache is cleared since a bundle may set its own pipeline, bind groups, and buffers.
Pass a whole run of bundles rather than calling this once per bundle: WebGPU resets the pass state after every call, so N calls cost N cache clears and N trips through the binding layer for exactly the same result.
Every bundle must have been recorded against a matching render target — check with isBundleValid first and re-record if it says no, as Pixi cannot rebuild your draw commands for you.
The render bundle to execute, or a run of them to execute in one call.
Checks whether a recorded bundle can still be replayed against the render target that is bound now.
A bundle permanently bakes the attachment state it was recorded with — color format(s), color target count, depth/stencil format, sample count — and WebGPU rejects the entire command buffer if any of it differs at execute time. It also bakes the front-face winding of its pipelines, which WebGPU does not validate: once the target's RenderTarget.flipY parity changes, replaying silently renders geometry inside out.
Ask before replaying rather than after: only the caller owns the draw commands, so only the
caller can re-record. A missing bundle reports false, so !isBundleValid(bundles[i]) reads
correctly on the first frame, before anything has been recorded.
The bundle to check, as returned by endBundle.
true if the bundle is safe to execute right now, false if it must be re-recorded.
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.