Documentation
    Preparing search index...

    Class RenderTargetCache

    Per-context store of allocated framebuffers (§61, §48, §63).

    One cache belongs to one GL context: the renderer builds it during initialize and builds a new one on context restore, since every handle the old one held died with the context.

    const cache = new RenderTargetCache(gl);
    const record = cache.acquire(target);
    if (record !== null) {
    gl.bindFramebuffer(GL.FRAMEBUFFER, record.framebuffer);
    // draw…
    gl.bindFramebuffer(GL.FRAMEBUFFER, null);
    }
    Index
    • get size(): number

      Number of framebuffers currently allocated. Diagnostics and tests (§83, §84).

      Returns number

    • Returns the framebuffer for target, allocating it on first use and re-allocating it whenever target.version has advanced.

      Returns null — and creates no entry — when the target has been disposed, when GL refuses to allocate an object, or when the assembled framebuffer is not complete. Never throws: this runs inside Renderer.render, and §61 forbids throwing there for a lost context; a failed allocation is the same class of asynchronous, driver-scheduled event, so it skips the pass rather than unwinding the frame.

      Parameters

      Returns RenderTargetRecord | null

    • Deletes every framebuffer, colour texture and depth buffer this cache created (§83). Idempotent.

      Only valid on a live context — the renderer calls RenderTargetCache.forget instead when the context is lost. The application's RenderTarget objects are untouched: the renderer did not create them, so it does not dispose them.

      Returns void

    • Drops every record without touching the context — the context-loss path (§61). The handles are already invalid; deleting them would be a GL call against a lost context for no benefit.

      Returns void