bindVertexBuffer method

  1. @override
void bindVertexBuffer(
  1. GeometryBuffer buffer,
  2. int vertexCount, {
  3. int slot = 0,
})

Binds geometry the device already holds — a mesh, or the one triangle every full-screen pass draws.

slot is which of the pipeline's VertexLayoutSpec.buffers this fills. Zero is the only slot anything used before instancing, and slots must be filled densely — see the note on VertexLayoutSpec.

Implementation

@override
void bindVertexBuffer(
  GeometryBuffer buffer,
  int vertexCount, {
  int slot = 0,
}) {
  final geometry = buffer.backend as WebGpuGeometry;
  _vertexBuffers[slot] = (
    buffer: geometry.buffer,
    offset: buffer.offsetInBytes,
    length: buffer.lengthInBytes,
  );
}