defaultVertexLayout property

  1. @override
VertexLayoutDescriptor? get defaultVertexLayout
override

The layout this geometry kind uses when the caller supplies none. Subclasses that describe their vertices override this.

Implementation

@override
VertexLayoutDescriptor? get defaultVertexLayout {
  final base = _isDeInterleaved
      ? kUnskinnedSoAColorLayout
      : kUnskinnedInstancedLayout;
  if (!hasCustomAttributes) return base;
  // Splice the custom attribute buffers in before the trailing instance-rate
  // model-transform buffer, so their slots follow the built-in streams and
  // the instance buffer stays at the last slot (vertexStreamCount).
  return VertexLayoutDescriptor(
    buffers: [
      ...base.buffers.sublist(0, base.buffers.length - 1),
      ...customAttributeBuffers,
      base.buffers.last,
    ],
  );
}