VertexAttribute class final

Describes a single vertex attribute: which shader input it feeds (by name), its byte offset within the owning vertex buffer's element, and its format.

The name must exactly match an in (or equivalent stage input) declaration in the bound vertex shader. Looking the attribute up by name (rather than by raw location index) keeps Dart-side layouts robust to shader source edits, mirroring how uniform bindings are resolved by name via Shader.getUniformSlot.

Two attributes within the same VertexBuffer must not occupy overlapping byte ranges (i.e. [offsetInBytes, offsetInBytes + format.bytesPerElement) ranges must be disjoint across the buffer's attributes).

Constructors

VertexAttribute({required String name, required VertexFormat format, int offsetInBytes = 0})
Creates a vertex attribute description bound to the shader-side input named name, reading its data in the given format starting at byte offsetInBytes into each element of the owning vertex buffer.
const

Properties

format VertexFormat
Format of each attribute element.
final
hashCode int
The hash code for this object.
no setterinherited
name String
Name of the shader-side input this attribute feeds (e.g. position).
final
offsetInBytes int
Byte offset of this attribute from the start of each element in the owning vertex buffer. Must satisfy offsetInBytes + format.bytesPerElement <= VertexBuffer.strideInBytes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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