# GraphicsBuffer

> Create a Graphics Buffer.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## GraphicsBuffer(Target, int, int)

Create a Graphics Buffer.

```csharp
public GraphicsBuffer(GraphicsBuffer.Target target, int count, int stride)
```

### Parameters

**** (\[Target]\(/engine/6000.5/script-reference/unityengine/graphicsbuffer/target)): Specify how this buffer can be used within the graphics pipeline.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of elements in the buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size of one element in the buffer. For index buffers, this must be either 2 or 4 bytes.

### Remarks

Use [GraphicsBuffer.Release](/engine/6000.5/script-reference/unityengine/graphicsbuffer/release.md) to release the buffer when no longer needed.

If the buffer size exceeds the value in [SystemInfo.maxGraphicsBufferSize](/engine/6000.5/script-reference/unityengine/systeminfo/maxgraphicsbuffersize.md), the constructor raises an exception.

Additional Resources: [Graphics.RenderPrimitives](/engine/6000.5/script-reference/unityengine/graphics/renderprimitives.md).

## GraphicsBuffer(Target, UsageFlags, int, int)

Create a Graphics Buffer.

```csharp
public GraphicsBuffer(GraphicsBuffer.Target target, GraphicsBuffer.UsageFlags usageFlags, int count, int stride)
```

### Parameters

**** (\[Target]\(/engine/6000.5/script-reference/unityengine/graphicsbuffer/target)): Specify how this buffer can be used within the graphics pipeline.**** (\[UsageFlags]\(/engine/6000.5/script-reference/unityengine/graphicsbuffer/usageflags)): Select what kind of update mode the buffer will have.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of elements in the buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Size of one element in the buffer. For index buffers, this must be either 2 or 4 bytes.

### Remarks

Use [GraphicsBuffer.Release](/engine/6000.5/script-reference/unityengine/graphicsbuffer/release.md) to release the buffer when no longer needed.

If the buffer size exceeds the value in [SystemInfo.maxGraphicsBufferSize](/engine/6000.5/script-reference/unityengine/systeminfo/maxgraphicsbuffersize.md), the constructor raises an exception.

Additional Resources: [Graphics.RenderPrimitives](/engine/6000.5/script-reference/unityengine/graphics/renderprimitives.md).
