the owning renderer
Optionalsettings: object
batcher settings (see WebGPUBatcher#init)
the renderer this batcher is bound to
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
release this batcher's GPU resources
record the pending vertices as one draw in the frame's open pass
Optionaltopology: string = ...
override the batcher's default topology
Initialize (or re-initialize after device loss) this batcher.
the owning renderer
Optionalsettings: {batcher settings
Optionalattributes?: object[]neutral attribute descriptors
OptionalmaxVertices?: numberstaging capacity in vertices
OptionalshaderKey?: stringpipeline-cache shader family
Optionaltopology?: stringdefault portable topology
record the actual draw call — non-indexed by default; the quad batcher overrides with its indexed 6-per-quad pattern
the open pass
pending vertex count
drop any pending vertices (game reset)
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 base WebGPU Batcher — realizes the backend-neutral Batcher lifecycle (
init/bind/unbind/flush/reset/destroy, driven byrenderer.addBatcher/setBatcher) on aGPURenderPassEncoderinstead of GL state. Custom WebGPU batchers extend this class.A "flush" here is one
queue.writeBufferof 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 ofsrc/video/gpu/vertexformat.tsand consumed declaratively into the pipeline'sGPUVertexBufferLayout(#1492) — no enum bridge.