the owning renderer
Optionalsettings: object
batcher settings (see WebGPUBatcher#init)
the renderer this batcher is bound to
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.
the texture atlas to draw with
destination x
destination y
destination width
destination height
texture UV (u0)
texture UV (v0)
texture UV (u1)
texture UV (v1)
tint color in UINT32 (argb) format
Optionalreupload: boolean = false
force the source pixels to re-upload (video frames)
make this batcher the active one — nothing per-batcher persists on the pass in the 2D tier; this is the seam where the mesh batcher will later select its depth-enabled pipeline family
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).
the owning renderer
indexed draw: 6 indices per 4 queued vertices, region-relative. The fast path binds its single-source material; the normal path binds the composed segment (up to eight textures).
the open pass
pending vertex count
called when another batcher takes over
per-draw refresh hook (pass-scoped state that bind() cannot own
because setBatcher early-returns when already current)
The WebGPU quad batcher — textured-quad accumulation with the same frozen 28-byte vertex layout as the WebGL
QuadBatcherand 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
aTextureIdattribute 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 onewriteBufferof the pending bytes plus onedrawIndexed, so the per-change cost is far below the GL full-buffer re-upload this design avoids there.