UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

32 lines (31 loc) 1.03 kB
/** * @import { GraphicsDevice } from './graphics-device.js' */ /** * A base class representing a single per platform buffer. * * @ignore */ export class DynamicBuffer { constructor(device: any); /** @type {GraphicsDevice} */ device: GraphicsDevice; /** * A cache of bind groups for each uniform buffer size, which is used to avoid creating a new * bind group for each uniform buffer. * * @type {Map<number, BindGroup>} */ bindGroupCache: Map<number, BindGroup>; bindGroupFormat: BindGroupFormat; /** * Upload the buffer's data to the GPU. A no-op on backends (such as WebGPU) that copy the data * to the GPU separately; WebGL overrides this to eagerly upload, as it has no buffer mapping and * executes draws immediately. */ upload(): void; getBindGroup(ub: any): BindGroup; } import type { GraphicsDevice } from './graphics-device.js'; import { BindGroup } from './bind-group.js'; import { BindGroupFormat } from './bind-group-format.js';