# GraphicsBufferHandle

> Stores the internal handle of a GraphicsBuffer using a plain integer value.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<GraphicsBufferHandle>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public readonly struct GraphicsBufferHandle : IEquatable<GraphicsBufferHandle>
```

## Remarks

The purpose of `GraphicsBufferHandle` is to represent a [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) using a struct which can be stored in unmanaged memory. This is necessary to interact with certain Unity APIs that may involve `unsafe`, Burst compatible code, and/or unmanaged memory such as NativeArray. For example, some parts of the [BatchRendererGroup](/engine/6000.5/script-reference/unityengine/rendering/batchrenderergroup.md) API use `GraphicsBufferHandle` to be able to set buffers from Burst compatible code.

Any `GraphicsBufferHandle` instances with the same `value` are completely equivalent to one another. A `GraphicsBufferHandle` can be manually constructed with any `uint` value that originates from a valid `GraphicsBufferHandle.value`. For example, you could store the `value` into a `NativeArray<uint>`, and later construct a new `GraphicsBufferHandle` with the same integer read from the array, and it would be equivalent to the original `GraphicsBufferHandle`.

A `GraphicsBufferHandle` is valid as long as the [GraphicsBuffer](/engine/6000.5/script-reference/unityengine/graphicsbuffer.md) it has been fetched from has not been disposed.

## Fields

| Value                                                                              | Description                                       |
| ---------------------------------------------------------------------------------- | ------------------------------------------------- |
| [value](/engine/6000.5/script-reference/unityengine/graphicsbufferhandle/value.md) | The integer value of this `GraphicsBufferHandle`. |

## Methods

| Method                                                                                     | Description                                                                                                                                   |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [CompareTo](/engine/6000.5/script-reference/unityengine/graphicsbufferhandle/compareto.md) | Compares this `GraphicsBufferHandle` with another to determine their relative positions in the sort order, according to their integer values. |
| [Equals](/engine/6000.5/script-reference/unityengine/graphicsbufferhandle/equals.md)       | Checks if this `GraphicsBufferHandle` and another are equal, based on their integer values.                                                   |
