Skip to content

VertexAttribute

data class VertexAttribute(
    val format: GPUVertexFormat, 
    val offset: GPUSize64, 
    val shaderLocation: GPUIndex32
) : GPUVertexAttribute
Describes one vertex attribute's format and byte offset in a vertex buffer.

Constructors

VertexAttribute

constructor(
    format: GPUVertexFormat, 
    offset: GPUSize64, 
    shaderLocation: GPUIndex32
)

Properties

format

open override val format: GPUVertexFormat
The GPUVertexFormat of the attribute. See [GPUVertexAttribute.format in the WebGPU specification](https://www.w3.org/TR/webgpu/#dom-gpuvertexattribute-format).

offset

open override val offset: GPUSize64
The offset, in bytes, from the beginning of the element to the data for the attribute.

shaderLocation

open override val shaderLocation: GPUIndex32
The numeric location associated with this attribute, which will correspond with a "@location" attribute declared in the vertex.module.