# SetBatchBuffer(BatchID, GraphicsBufferHandle)

> Change the GraphicsBuffer associated with the given batch.

## Definition

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

```csharp
public void SetBatchBuffer(BatchID batchID, GraphicsBufferHandle buffer)
```

### Parameters

**** (\[BatchID]\(/engine/7000.0/script-reference/unityengine/rendering/batchid)): Unity changes the batch with this ID.**** (\[GraphicsBufferHandle]\(/engine/7000.0/script-reference/unityengine/graphicsbufferhandle)): The `GraphicsBufferHandle` of the `GraphicsBuffer` to be associated with the batch.

### Remarks

You can call this method at any time, but Unity doesn't apply the change immediately. Unity applies the change the next time it starts a culling pass, before it calls `OnPerformCulling`. Until then, draw commands that Unity has already generated still use the previous buffer.

Don't dispose of the previous `GraphicsBuffer` in the same frame that you call this method. Instead, dispose of it in the next frame, for example in the next `Update` call. If Unity renders draw commands that refer to a disposed buffer, the result is undefined.
