toGpuLayout method

VertexLayout toGpuLayout()

Lowers this description to the flutter_gpu pipeline layout, validating it first.

Called at pipeline-creation time (once per interned layout). Throws an ArgumentError when an attribute would read past its slot's stride or when an attribute name is reused, so a malformed layout fails loudly here instead of producing silently wrong rendering.

Implementation

gpu.VertexLayout toGpuLayout() {
  _validate();
  return gpu.VertexLayout(
    buffers: [for (final buffer in buffers) buffer._toGpu()],
  );
}