/** * The WebGPU quad batcher — textured-quad accumulation with the same * frozen 28-byte vertex layout as the WebGL `QuadBatcher` and the same * static 6-indices-per-quad pattern. * * Texture batching is single-texture-per-draw-segment in this first * version: a texture (bind group) change flushes the pending quads — the * `aTextureId` attribute is written as 0 and kept in the layout so the * later multi-texture upgrade (`binding_array` / texture arrays) changes * only the group-1 layout and the fragment shader, never the vertex * stream. A WebGPU flush is one `writeBuffer` of the pending bytes plus * one `drawIndexed`, so the per-change cost is far below the GL * full-buffer re-upload this design avoids there. * @augments WebGPUBatcher * @category Rendering */ export default class WebGPUQuadBatcher extends WebGPUBatcher { /** * @param {import("../webgpu_renderer.js").default} renderer - the owning renderer * @override */ override init(renderer: import("../webgpu_renderer.js").default, settings: any): void; currentMaterial: any; currentEffect: any; slotTable: TextureSlotTable | undefined; /** @type {{view: GPUTextureView, sampler: GPUSampler}[]} indexed by slot */ segmentEntries: { view: GPUTextureView; sampler: GPUSampler; }[] | undefined; segmentGroup: GPUBindGroup | null | undefined; /** @type {Map} */ composedGroups: Map | undefined; resourceIds: WeakMap | undefined; nextResourceId: number | undefined; indexBuffer: GPUBuffer | null | undefined; /** * Add a textured quad. Same contract as the WebGL `QuadBatcher.addQuad` * — the CPU corner transform (view matrix + per-renderable depth) is * identical, only the texture-binding mechanism differs. * @param {object} texture - the texture atlas to draw with * @param {number} x - destination x * @param {number} y - destination y * @param {number} w - destination width * @param {number} h - destination height * @param {number} u0 - texture UV (u0) * @param {number} v0 - texture UV (v0) * @param {number} u1 - texture UV (u1) * @param {number} v1 - texture UV (v1) * @param {number} tint - tint color in UINT32 (argb) format * @param {boolean} [reupload=false] - force the source pixels to re-upload (video frames) */ addQuad(texture: object, x: number, y: number, w: number, h: number, u0: number, v0: number, u1: number, v1: number, tint: number, reupload?: boolean): void; /** * Drop every composed segment bind group — each embeds samplers * resolved from the default texture filter, so a filter change must * rebuild them (the multi-texture counterpart of the texture store's * invalidateBindGroups). */ clearMaterialCache(): void; /** * @override */ override flush(topology: any): void; } import WebGPUBatcher from "./webgpu_batcher.js"; import { TextureSlotTable } from "../../gpu/textureslots.js"; //# sourceMappingURL=quad_batcher.d.ts.map