Class BatchReadback
Batches GPU texture readback requests and flushes them in groups to reduce per-frame overhead.
Inherited Members
Namespace: Unity.SimulationPro
Assembly: Unity.SimulationPro.Capture.dll
Syntax
public class BatchReadback
Remarks
Requests accumulate until BatchSize is reached, then are flushed automatically. The batch is also flushed on shutdown via Manager notification. When async GPU readback is supported it is used; otherwise pixels are read synchronously.
Fields
BatchSize
Number of queued requests that triggers an automatic flush. Defaults to 50.
Declaration
public int BatchSize
Field Value
| Type | Description |
|---|---|
| int |
Properties
Instance
Gets the singleton BatchReadback instance, creating it on first access.
Declaration
public static BatchReadback Instance { get; }
Property Value
| Type | Description |
|---|---|
| BatchReadback |
Methods
QueueReadback(AsyncRequest<CaptureState>, Channel, RenderTexture)
Queue a rendertexture for readback. The readback will happen after the number of requests reaches the batchsize.
Declaration
public void QueueReadback(AsyncRequest<CaptureCamera.CaptureState> request, CaptureCamera.Channel channel, RenderTexture renderTexture)
Parameters
| Type | Name | Description |
|---|---|---|
| AsyncRequest<CaptureCamera.CaptureState> | request | The request associated with this batch readback instance. |
| CaptureCamera.Channel | channel | Which channel this readback is for. |
| RenderTexture | renderTexture | Render texture to readback. |
Shutdown()
Releases all pending requests and clears the singleton instance.
Declaration
public void Shutdown()