Documentation
    Preparing search index...

    Class WgpuRenderTargetCache

    Per-device store of allocated render targets (§61, §48, §63, WP-R1.6).

    One cache belongs to one device; the renderer builds it during initialize — the constructor allocates nothing, so a frame that never names a target records exactly the transcript it always did — and drops it whole on device loss.

    const record = renderTargets.acquire(target);
    if (record !== null) {
    // attach record.colorView / record.depthView, draw…
    }
    Index
    • Returns the allocations for target, allocating on first use and re-allocating whenever target.version has advanced (a resize(), whose documented cost this is).

      Returns null — and creates no entry — for a disposed target or a disposed cache, so the pass is skipped rather than drawn into a released surface (§83). Never throws: this runs inside Renderer.render (§61).

      Parameters

      Returns WgpuRenderTargetRecord | null

    • Destroys every texture this cache created (§83). Idempotent. Samplers and bind groups have no destroy(); dropping the map is their release. The application's RenderTarget objects are untouched — the renderer did not create them.

      Returns void

    • Drops every record without destroying anything — the device-loss path (§61): the allocations belong to a device that no longer exists.

      Returns void

    • The bind group for sampling target's colour attachment — the seam a draw whose material's map is a render-target texture resolves through, and the one renderEffect sources from (they are deliberately the same group: a bind group carries no index, so one object serves group 1, group 2 and the effect's group 0).

      null exactly when WgpuRenderTargetCache.acquire answers null. Creates the shared sampler and this record's bind group on first use.

      Parameters

      Returns object | null

    • The one sampler every sampled target shares — linear, clamped, the fixed state gl-render-target.ts writes on every colour attachment — created on first use, by whichever of WgpuRenderTargetCache.sample or a node program's group composition asks first (WP-R1.9: one object, so a frame mixing both paths allocates one sampler, not two).

      Returns object