debugTrackedResourceCount property

int get debugTrackedResourceCount

Every GPU object this device owns and would have to release: the textures and geometry it handed out, the frame arenas and fallbacks it made for itself, and the modules, layouts, samplers, bind groups and _pipelines it cached.

Not zero on a fresh device, unlike the WebGL2 backend's count of the same name, and the difference is a fact about the two APIs rather than about the two implementations: this one allocates three arena buffers and a zeroed block before it is asked for anything. What it is for is the same — a leak is a number that climbs while a frame repeats — and it falls to zero after dispose just the same.

Implementation

int get debugTrackedResourceCount =>
    _textures.length +
    _buffers.length +
    _uniformArena.bufferCount +
    _vertexArena.bufferCount +
    _indexArena.bufferCount +
    (_disposed ? 0 : 1) +
    _library.debugTrackedModuleCount +
    _bindingLayouts.length +
    _samplers.length +
    _bindGroups.length +
    _pipelines.length;