Remove waits for 2x perf
m_InstancePath = $"{k_Directory}/{k_FilePrefix}{frameCount}.png";
var localPath = $"{Manager.Instance.GetDirectoryFor(k_Directory)}/{k_FilePrefix}{frameCount}.png";
var colors = new NativeArray<Color32>(data, Allocator.TempJob);
var colors = new NativeArray<Color32>(data, Allocator.Persistent);
var asyncRequest = Manager.Instance.CreateRequest<AsyncRequest<AsyncWrite>>();
});
asyncRequest.data = new AsyncSemanticSegmentationWrite
{
data = new NativeArray<Color32>(data, Allocator.TempJob),
data = new NativeArray<Color32>(data, Allocator.Persistent),
width = targetTexture.width,
height = targetTexture.height,
path = localPath
// Jobs are not chained to one another in any way, maximizing parallelism
AsyncRequest.maxJobSystemParallelism = 0;
// Ensure that read-backs happen before Allocator.TempJob allocations get stale
AsyncRequest.maxAsyncRequestFrameAge = 4;
AsyncRequest.maxAsyncRequestFrameAge = 0;
Application.runInBackground = true;