浏览代码

Removing frame limiter on AsyncRequests and switching necessary allocations to Persistent. Improves frame rate in SynthDet V2 by ~2x

/0.8.0-preview.1_staging
Jon Hogins 4 年前
当前提交
660f2de6
共有 3 个文件被更改,包括 3 次插入5 次删除
  1. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs
  2. 2
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  3. 4
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs

2
com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs


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>>();

2
com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs


});
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

4
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


{
// 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;

正在加载...
取消
保存