uploadGeometry method

  1. @override
GeometryBuffer uploadGeometry(
  1. ByteData bytes,
  2. GeometryUsage usage
)

Uploads geometry that will outlive the frame.

Every mesh in the engine comes through here, plus the two buffers the renderer keeps: the full-screen triangle and the identity index sequence the debug overlay draws through. Per-frame geometry does not — see PassEncoder.bindVertexData.

usage is required and cannot be defaulted; see GeometryUsage for the backend that binds a buffer to its target permanently.

Implementation

@override
GeometryBuffer uploadGeometry(ByteData bytes, GeometryUsage usage) => guard(
  'a ${bytes.lengthInBytes}-byte ${usage.name} buffer',
  () => webgpuUploadGeometry(gpuDevice, _buffers, bytes, usage),
);