Hi!
I’m playing with Job System, implemented simple scenario where cubes are falling down and being respawned once they hit a certain Y level. I have two jobs, the second dependent on the first. They both are referencing the same native array for transforms. It runs without errors/warnings but the job is never split among job threads.
Job’s code:
namespace Ships.JobSystem
{
[BurstCompile]
public struct MoveJob : IJobParallelForTransform
{
public float speed;
public float deltaTime;
public void Execute(int index, TransformAccess transform)
{
Vector3 position = transform.position;
position = position + new Vector3(0, speed, 0) * deltaTime;
transform.position = position;
}
}
}
Profiler as the proof (development build, not taken from the editor):
Stats window:
I’m running
Version 2018.2.0b8 (fed204371f5a)
Wed, 30 May 2018 15:35:38 GMT
Branch: 2018.2/staging
My project manifest:
{
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.analytics": "2.0.16",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.ads": "2.0.8",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.textmeshpro": "1.2.1",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.purchasing": "2.0.1",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.standardevents": "1.0.13",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.xr": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.entities": "0.0.12-preview.6",
"com.unity.modules.animation": "1.0.0",
"com.unity.package-manager-ui": "2.0.0-preview.3",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.incrementalcompiler": "0.0.42-preview.1"
},
"registry": "https://packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
]
}
Any suggestions what I might have missed to make my job be split among threads?
Thank you!
Jakub