melonJS
    Preparing search index...

    Class WebGPUPrimitiveBatcher

    The WebGPU primitive batcher — shape geometry accumulation with the same frozen 24-byte vertex layout and CPU tessellation as the WebGL PrimitiveBatcher, addressed purely in the portable topology vocabulary.

    uLineWidth lives in the shared frame-globals uniform block: a width change flushes pending vertices and pushes a fresh dynamic-offset slot, replacing the per-program uniform of the GL backend.

    The two non-portable engine topologies are emulated in this front end, as PORTABLE_TOPOLOGIES documents: "line-loop" draws as a strip with an explicit closing vertex, "triangle-fan" re-expands on the CPU into a triangle list. No engine path emits either — they only serve direct user calls.

    Hierarchy (View Summary)

    Index
    attributes: { bytes: number; format: any; name: any; offset: any }[] | undefined
    device: GPUDevice | undefined
    renderer: Renderer | undefined

    the renderer this batcher is bound to

    shaderKey: string | undefined
    stride: any
    topology: string | undefined
    vertexData: VertexArrayBuffer | undefined
    vertexSize: number | undefined
    • Draw an array of vertices with the given topology.

      Parameters

      • topology: string

        portable topology name ("point-list", "line-list", "line-strip", "triangle-list", "triangle-strip"; "line-loop" and "triangle-fan" are emulated)

      • verts: Point[]

        an array of vertices

      • OptionalvertexCount: number = verts.length

        amount of points defined in the points array

      Returns void