| Parameter | Description |
|---|---|
| batchID | Unity changes the batch with this ID. |
| buffer | The GraphicsBufferHandle of the GraphicsBuffer to be associated with the batch. |
Change the GraphicsBuffer associated with the given batch.
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.