/** * The base WebGPU Batcher — realizes the backend-neutral {@link Batcher} * lifecycle (`init` / `bind` / `unbind` / `flush` / `reset` / `destroy`, * driven by `renderer.addBatcher` / `setBatcher`) on a * `GPURenderPassEncoder` instead of GL state. Custom WebGPU batchers * extend this class. * * A "flush" here is one `queue.writeBuffer` of the pending vertex bytes * into a fresh region of the renderer's per-frame buffer arena, plus one * draw recorded into the frame's open pass — nothing is submitted until * the frame ends. Attribute layouts are declared in the backend-neutral * vocabulary of `src/video/gpu/vertexformat.ts` and consumed declaratively * into the pipeline's `GPUVertexBufferLayout` (#1492) — no enum bridge. * @augments Batcher * @category Rendering */ export default class WebGPUBatcher extends Batcher { /** * @param {import("../webgpu_renderer.js").default} renderer - the owning renderer * @param {object} [settings] - batcher settings (see {@link WebGPUBatcher#init}) */ constructor(renderer: import("../webgpu_renderer.js").default, settings?: object); /** * Initialize (or re-initialize after device loss) this batcher. * @param {import("../webgpu_renderer.js").default} renderer - the owning renderer * @param {object} [settings] - batcher settings * @param {object[]} [settings.attributes] - neutral attribute descriptors * @param {string} [settings.shaderKey] - pipeline-cache shader family * @param {string} [settings.topology] - default portable topology * @param {number} [settings.maxVertices] - staging capacity in vertices */ init(renderer: import("../webgpu_renderer.js").default, settings?: { attributes?: object[] | undefined; shaderKey?: string | undefined; topology?: string | undefined; maxVertices?: number | undefined; }): void; device: GPUDevice | undefined; shaderKey: string | undefined; topology: string | undefined; attributes: { name: any; format: any; offset: any; bytes: number; }[] | undefined; stride: any; vertexSize: number | undefined; vertexData: VertexArrayBuffer | undefined; /** * per-draw refresh hook (pass-scoped state that `bind()` cannot own * because `setBatcher` early-returns when already current) */ updatePassState(): void; /** * record the pending vertices as one draw in the frame's open pass * @param {string} [topology] - override the batcher's default topology */ flush(topology?: string): void; /** * record the actual draw call — non-indexed by default; the quad * batcher overrides with its indexed 6-per-quad pattern * @param {GPURenderPassEncoder} pass - the open pass * @param {number} vertexCount - pending vertex count */ recordDraw(pass: GPURenderPassEncoder, vertexCount: number): void; } import { Batcher } from "../../gpu/batcher.js"; import VertexArrayBuffer from "../../buffer/vertex.js"; //# sourceMappingURL=webgpu_batcher.d.ts.map