# AddBatch

> Thread-safe alias for BatchRendererGroup.AddBatch.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.6/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

## AddBatch(NativeArray\<MetadataValue>, GraphicsBufferHandle)

Thread-safe alias for [BatchRendererGroup.AddBatch](/engine/6000.6/script-reference/unityengine/rendering/batchrenderergroup/addbatch.md).

```csharp
public BatchID AddBatch(NativeArray<MetadataValue> batchMetadata, GraphicsBufferHandle buffer)
```

### Parameters

**** (\[NativeArray\<MetadataValue>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): Metadata properties for this batch.**** (\[GraphicsBufferHandle]\(/engine/6000.6/script-reference/unityengine/graphicsbufferhandle)): The `GraphicsBufferHandle` of the `GraphicsBuffer` associated with this batch.

### Returns

| Type                                                                        | Description                         |
| --------------------------------------------------------------------------- | ----------------------------------- |
| [BatchID](/engine/6000.6/script-reference/unityengine/rendering/batchid.md) | ID of the batch that Unity creates. |

## AddBatch(NativeArray\<MetadataValue>, GraphicsBufferHandle, uint, uint)

Thread-safe alias for [BatchRendererGroup.AddBatch](/engine/6000.6/script-reference/unityengine/rendering/batchrenderergroup/addbatch.md).

```csharp
public BatchID AddBatch(NativeArray<MetadataValue> batchMetadata, GraphicsBufferHandle buffer, uint bufferOffset, uint windowSize)
```

### Parameters

**** (\[NativeArray\<MetadataValue>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): Metadata properties for this batch.**** (\[GraphicsBufferHandle]\(/engine/6000.6/script-reference/unityengine/graphicsbufferhandle)): The `GraphicsBufferHandle` of the `GraphicsBuffer` associated with this batch.**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Offset of the buffer to be bound. Defaults to zero (start of the buffer).**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): Amount of data in the buffer to be bound, starting from the bufferOffset value. Defaults to zero. If this is a constant buffer, this value must be less or equal to \[SystemInfo.maxConstantBufferSize].

### Returns

| Type                                                                        | Description                         |
| --------------------------------------------------------------------------- | ----------------------------------- |
| [BatchID](/engine/6000.6/script-reference/unityengine/rendering/batchid.md) | ID of the batch that Unity creates. |
