# VertexBufferLayout

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/VertexLayout.kt+class:androidx.xr.scenecore.VertexBufferLayout) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class VertexBufferLayout
```

<br />

*** ** * ** ***

Layout of a vertex buffer, composed of multiple attribute descriptors.

If the stride is set to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()`, the stride will be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer. The stride must be `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` or a positive value up to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#MAX_STRIDE()`.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#attributes()` is empty, if `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#stride()` is not `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` and not between 1 and `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#MAX_STRIDE()`, if any attributes overlap, or if `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#stride()` is not `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` and is smaller than the minimum byte stride required to encompass all attributes. |

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` Indicates that the buffer stride should be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#MAX_STRIDE() = 32767` The maximum allowed byte stride for a vertex buffer (32767). |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#VertexBufferLayout(kotlin.collections.List,kotlin.Int)( attributes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor>, stride: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor>` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#attributes()` List of `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor`s defining the layout within this buffer. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexBufferLayout#stride()` The byte stride of the buffer. |

## Constants

### AUTO_STRIDE

```
const val AUTO_STRIDE: Int
```

Indicates that the buffer stride should be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer.

### MAX_STRIDE

```
const val MAX_STRIDE = 32767: Int
```

The maximum allowed byte stride for a vertex buffer (32767).

## Public constructors

### VertexBufferLayout

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
VertexBufferLayout(
    attributes: List<VertexAttributeDescriptor>,
    stride: @IntRange(from = -1, to = 32767) Int = AUTO_STRIDE
)
```

| Parameters |
|---|---|
| `attributes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor>` | List of `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor`s defining the layout within this buffer. |
| `stride: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = -1, to = 32767) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = AUTO_STRIDE` | The byte stride of the buffer. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### attributes

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val attributes: List<VertexAttributeDescriptor>
```

List of `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/VertexAttributeDescriptor`s defining the layout within this buffer.

### stride

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val stride: @IntRange(from = -1, to = 32767) Int
```

The byte stride of the buffer.