uploadGeometry method
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) {
final buffer = inner.uploadGeometry(bytes, usage);
_baseOffsets[buffer.backend] = buffer.offsetInBytes;
events.add(
TraceUploadGeometry(
id: _name(_geometryIds, buffer.backend),
usage: usage,
bytes: _copy(bytes),
),
);
return buffer;
}