Skip to content

Commit 3502511

Browse files
authored
Merge pull request #250 from Unity-Technologies/fix_waits
Remove waits for 2x perf
2 parents c53a61d + 3fbf67c commit 3502511

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void OnImageCaptured(int frameCount, NativeArray<Color32> data, RenderTexture re
130130
m_InstancePath = $"{k_Directory}/{k_FilePrefix}{frameCount}.png";
131131
var localPath = $"{Manager.Instance.GetDirectoryFor(k_Directory)}/{k_FilePrefix}{frameCount}.png";
132132

133-
var colors = new NativeArray<Color32>(data, Allocator.TempJob);
133+
var colors = new NativeArray<Color32>(data, Allocator.Persistent);
134134

135135
var asyncRequest = Manager.Instance.CreateRequest<AsyncRequest<AsyncWrite>>();
136136

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void OnSemanticSegmentationImageRead(int frameCount, NativeArray<Color32> data)
233233
});
234234
asyncRequest.data = new AsyncSemanticSegmentationWrite
235235
{
236-
data = new NativeArray<Color32>(data, Allocator.TempJob),
236+
data = new NativeArray<Color32>(data, Allocator.Persistent),
237237
width = targetTexture.width,
238238
height = targetTexture.height,
239239
path = localPath

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ void Start()
192192
{
193193
// Jobs are not chained to one another in any way, maximizing parallelism
194194
AsyncRequest.maxJobSystemParallelism = 0;
195-
196-
// Ensure that read-backs happen before Allocator.TempJob allocations get stale
197-
AsyncRequest.maxAsyncRequestFrameAge = 4;
195+
AsyncRequest.maxAsyncRequestFrameAge = 0;
198196

199197
Application.runInBackground = true;
200198

0 commit comments

Comments
 (0)