Taos API Reference
    Preparing search index...

    Class Pass<TDeps, TOutputs>Abstract

    Abstract base class for a render graph pass.

    A pass is a container for long-lived GPU state — pipelines, bind group layouts, samplers, persistent uniform buffers — that on each frame is inserted into a RenderGraph via addToGraph. The graph itself does not store pass instances; it stores the read/write declarations and execute callback that addToGraph registers via the supplied PassBuilder.

    Subclasses parameterize the dependency and output types so the factory can wire passes together with type-checked handles:

    class GeometryPass extends Pass<{ camera: ResourceHandle }, { albedo, normal, depth }> {
    readonly name = 'GeometryPass';
    addToGraph(graph, deps) { ... }
    }

    The convention is that the constructor builds long-lived state (pipelines etc.), addToGraph declares per-frame resource flow, and destroy releases anything the pass owns.

    Type Parameters

    • TDeps = undefined
    • TOutputs = void

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    name: string

    Human-readable identifier used in graph node labels and error messages.

    Methods

    • Insert the pass into graph for one frame. Implementations call graph.addPass(name, type, b => { ... }) exactly once and use the supplied PassBuilder to declare reads, writes, transient resources, and the execute callback.

      Parameters

      • graph: RenderGraph

        Graph being built this frame.

      • deps: TDeps

        Pass-specific dependency record (handles, scene data, etc.).

      Returns TOutputs

      Pass-specific output record (typically a set of handles downstream passes will consume).

    • Release every long-lived GPU resource owned by the pass (pipelines, persistent uniform buffers, samplers, BGLs). Called by the factory or application during teardown. Default implementation is a no-op.

      Returns void