> ## Documentation Index
> Fetch the complete documentation index at: https://rive.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GPUBuffer

A GPU buffer for vertex, index, or uniform data.

## Fields

### `size`

Size in bytes.

## Constructors

### `new`

<div class="signature">
  ```lua theme={null}
  new(desc: GPUBufferDesc) -> GPUBuffer
  ```
</div>

## Methods

### `write`

<div class="signature">
  ```lua theme={null}
  write(data: buffer, offset: number?) -> ()
  ```
</div>

Copy CPU data into the buffer.
@param data   Source bytes.
@param offset Byte offset into the GPU buffer (default 0).
