/** * A WebGL implementation of the VertexBuffer. * * @ignore */ export class WebglVertexBuffer extends WebglBuffer { vao: any; /** * The cache entries of draws which use this vertex buffer first, followed by further buffers, * keyed by the second buffer. See {@link WebglVertexArrayEntry}. * * @type {Map|null} */ vaoEntries: Map | null; /** * The maps of cache entries, stored on other buffers or entries, in which this buffer is a key. * * @type {Set>|null} */ vaoEntryMaps: Set> | null; unlock(vertexBuffer: any, byteOffset: any, byteLength: any): void; /** * Returns the cache entry for a draw using more than one vertex buffer, this one first. The * entry, and the entries leading to it, are created when missing. * * @param {VertexBuffer[]} vertexBuffers - The vertex buffers of the draw, this one first. * @returns {WebglVertexArrayEntry} The cache entry. */ getVertexArrayEntry(vertexBuffers: VertexBuffer[]): WebglVertexArrayEntry; /** * Deletes the vertex array objects using this vertex buffer: the one for draws using only this * buffer, and the cached ones for draws using it together with other buffers, whether stored on * this buffer or on others. * * The vertex array objects are deleted explicitly. Left to garbage collection, a vertex array * object keeps the buffers it references alive, the index buffer last drawn with it included, and * in Chrome its delayed release can leave a stale index buffer binding behind, which sends a * later index buffer upload to a deleted buffer. * * @param {WebGL2RenderingContext} gl - The WebGL context. */ deleteVertexArrays(gl: WebGL2RenderingContext): void; } import { WebglBuffer } from './webgl-buffer.js'; /** * @import { VertexBuffer } from '../vertex-buffer.js' */ /** * An entry in the cache of vertex array objects for draws using more than one vertex buffer. * * The vertex array object of such a draw is cached on its first vertex buffer, in a tree of entries * keyed by each further buffer: the entries keyed by the second buffer are stored on the first * buffer, the entries keyed by the third buffer on the entry of the second, and so on. A lookup * compares buffer objects only, so it allocates nothing, and each vertex array object has exactly * one entry. The buffers keying entries record the maps holding them, so that a vertex array object * is deleted as soon as any of its buffers is destroyed, and no buffer is left referencing it. * * @ignore */ declare class WebglVertexArrayEntry { /** * The vertex array object for the vertex buffers leading to this entry, or null if not created. * * @type {WebGLVertexArrayObject|null} */ vao: WebGLVertexArrayObject | null; /** * The entries for draws with further vertex buffers, keyed by the next buffer. * * @type {Map|null} */ next: Map | null; } import type { VertexBuffer } from '../vertex-buffer.js'; export {};