Documentation
    Preparing search index...

    Class WgpuGeometryCache

    Per-device store of uploaded geometry, keyed by BufferGeometry.id.

    const record = geometries.acquire(item.geometry);
    if (record !== null) {
    pass.setVertexBuffer(0, record.positionBuffer);
    pass.draw(record.count);
    }
    Index
    • Returns the buffers for geometry, uploading them on first use and re-uploading whenever geometry.version has advanced.

      normals says whether the draw at hand shades (WP-R1.5): true uploads the geometry's normal stream — with the initial upload, or as a one-buffer upgrade of a record first acquired by an unshaded draw — and false (the default, and every pre-WP-R1.5 call site verbatim) never touches it, so a scene with no lit materials records the byte-identical upload sequence it always did. skinning is the same flag for §54's joints and weights (RFC 0003): true uploads them on a skinned colour draw, false (the default, every pre-skinning call site verbatim) never touches them, so a skinless scene — and an unregistered skinned skip, which never asks — records the byte-identical upload sequence it always did. See the module header for why the flags are per acquisition.

      Returns null — and creates no entry — when there is nothing to draw (drawCount === 0, which includes every disposed geometry) or once the cache is disposed. Never throws: this runs inside Renderer.render, and §61 forbids throwing there.

      Parameters

      • geometry: BufferGeometry
      • normals: boolean = false
      • skinning: boolean = false

      Returns WgpuGeometryRecord | null

    • Drops every record without destroying anything — the device-loss path (§61). The allocations belong to a device that no longer exists; calling destroy() on them would be a call against a lost device for no benefit.

      Returns void