VertexBuffer class final
Describes one vertex buffer slot: its per-element stride, step mode, and the attributes that are read from it.
A buffer's position in VertexLayout.buffers determines the binding slot it is bound to via RenderPass.bindVertexBuffer; the first buffer is slot 0, the second is slot 1, and so on. Sparse binding slots are not currently supported.
The stepMode determines whether the buffer advances once per vertex or
once per instance. Keep the default VertexStepMode.vertex for mesh data
that describes the geometry being repeated. Use VertexStepMode.instance
for data that changes from one instance to the next when calling
RenderPass.draw or RenderPass.drawIndexed with an instanceCount
greater than 1.
Constructors
-
VertexBuffer({required int strideInBytes, required List<
VertexAttribute> attributes, VertexStepMode stepMode = VertexStepMode.vertex}) -
Creates a vertex buffer slot description with the given per-element
strideInBytesand the list ofattributesthat the vertex shader reads from this buffer.const
Properties
-
attributes
→ List<
VertexAttribute> -
Attributes read from this vertex buffer by the vertex shader.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stepMode → VertexStepMode
-
How this vertex buffer advances while drawing.
final
- strideInBytes → int
-
Byte distance from the start of one element to the start of the next
element in this vertex buffer (not the gap between an element's end and
the next element's start). Equivalent to the size of a single vertex
element plus any trailing padding before the next element begins. For a
tightly packed structure-of-arrays buffer carrying a single attribute,
this is the same as
attributes[0].format.bytesPerElement.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited