// ─── Handles ────────────────────────────────────────────────────────────
/**
 * Opaque handle referencing a resource within the render graph.
 *
 * Handles are obtained from {@link RGPassBuilder.createTexture}, {@link RGPassBuilder.createFramebuffer},
 * {@link RenderGraph.importTexture}, or {@link RGPassBuilder.write}. They are lightweight identifiers
 * used to declare dependencies between passes.
 *
 * @public
 */ class RGHandle {
    /** @internal */ _id;
    /** @internal */ _name;
    /** @internal */ constructor(id, name){
        this._id = id;
        this._name = name;
    }
    /** Debug-friendly name of the referenced resource. */ get name() {
        return this._name;
    }
}
/**
 * Internal bookkeeping for a resource within the render graph.
 * @public
 */ class RGResource {
    id;
    name;
    kind;
    desc;
    /** Resource ID of the physical backing resource used by imported versions. */ physicalId;
    /** The pass that creates / writes this resource (null for imported until written). */ producer = null;
    /** Passes that read this resource. */ consumers = [];
    constructor(id, name, kind, desc, physicalId = id){
        this.id = id;
        this.name = name;
        this.kind = kind;
        this.desc = desc;
        this.physicalId = physicalId;
    }
}
/**
 * Ordered execution step inside a render graph pass.
 *
 * Subpasses share the parent pass's resource declarations, lifetime, culling,
 * and access validation. They are intended to make multi-step pass bodies
 * explicit without splitting graph-level resource dependencies.
 *
 * @public
 */ class RGSubpass {
    name;
    executeFn;
    constructor(name, executeFn){
        this.name = name;
        this.executeFn = executeFn;
    }
}
/**
 * Internal bookkeeping for a pass within the render graph.
 * @public
 */ class RGPass {
    index;
    name;
    /** Resources this pass reads (dependencies). */ reads = [];
    /** Resources this pass creates or writes. */ writes = [];
    /** Passes that must complete before this pass due to non-resource hazards. */ dependencies = [];
    /** Whether this pass has side effects and must not be culled. */ hasSideEffect = false;
    /** User data returned from the setup function. */ data = null;
    /** Execute callback. */ executeFn = null;
    /** Ordered subpasses for passes with multiple logical execution steps. */ subpasses = [];
    /** Set during compilation: true if this pass is needed. */ alive = true;
    constructor(index, name){
        this.index = index;
        this.name = name;
    }
}

export { RGHandle, RGPass, RGResource, RGSubpass };
//# sourceMappingURL=types.js.map
