pixi.js
    Preparing search index...

    Class GpuEncoderSystemAdvanced

    The system that handles encoding commands for the GPU.

    Implements

    Index

    Constructors

    Properties

    commandEncoder: GPUCommandEncoder
    commandFinished: Promise<void>

    The 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.

    Methods

    • 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.

      Returns void

      If a render bundle is already being recorded.

    • Parameters

      • gpuRenderTarget: GpuRenderTarget

      Returns void

    • Generic destroy methods to be overridden by the subclass

      Returns void

    • Parameters

      • options: {
            baseVertex?: number;
            firstInstance?: number;
            geometry: Geometry;
            instanceCount?: number;
            shader: Shader;
            size?: number;
            skipSync?: boolean;
            start?: number;
            state?: State;
            topology?: Topology;
        }

      Returns void

    • 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.

      Parameters

      • options: {
            geometry: Geometry;
            indirectBuffer: GPUBuffer;
            indirectOffset: number;
            shader: Shader;
            skipSync?: boolean;
            state?: State;
            topology?: Topology;
        }

        The draw options.

        • geometry: Geometry

          The geometry to draw.

        • indirectBuffer: GPUBuffer

          The GPU buffer containing the indirect draw parameters.

        • indirectOffset: number

          Byte offset into the indirect buffer.

        • shader: Shader

          The shader to use.

        • OptionalskipSync?: boolean

          If true, skips syncing uniform groups to their GPU buffers.

        • Optionalstate?: State

          Optional render state (blending, depth, etc.).

        • Optionaltopology?: Topology

          Optional primitive topology override.

      Returns void

    • Returns void

    • 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.

      Parameters

      Returns void

    • Returns void

    • Returns void

    • Returns void

    • Parameters

      • index: number

      Returns void

    • Sets 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.

      Parameters

      • stencilReference: number

        The stencil reference value to use.

      Returns void