# 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)

*** ** * ** ***


```
public final class VertexBufferLayout
```

<br />

*** ** * ** ***

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

If the stride is set to `https://developer.android.com/reference/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/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` or a positive value up to `https://developer.android.com/reference/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/androidx/xr/scenecore/VertexBufferLayout#attributes()` is empty, if `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#stride()` is not `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` and not between 1 and `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#MAX_STRIDE()`, if any attributes overlap, or if `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#stride()` is not `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#AUTO_STRIDE()` and is smaller than the minimum byte stride required to encompass all attributes. |

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/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. |
| `static final int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#MAX_STRIDE() = 32767` The maximum allowed byte stride for a vertex buffer (32767). |

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor>` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#getAttributes()()` List of `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor`s defining the layout within this buffer. |
| `final int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#getStride()()` The byte stride of the buffer. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/scenecore/VertexBufferLayout#toString()()` |

## Constants

### AUTO_STRIDE

```
public static final int 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.

### MAX_STRIDE

```
public static final int MAX_STRIDE = 32767
```

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)

```
public VertexBufferLayout(
    @NonNull List<@NonNull VertexAttributeDescriptor> attributes,
    @IntRange(from = -1, to = 32767) int stride
)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor> attributes` | List of `https://developer.android.com/reference/androidx/xr/scenecore/VertexAttributeDescriptor`s defining the layout within this buffer. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = -1, to = 32767) int stride` | The byte stride of the buffer. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getAttributes

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

```
public final @NonNull List<@NonNull VertexAttributeDescriptor> getAttributes()
```

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

### getStride

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

```
public final int getStride()
```

The byte stride of the buffer.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```