Force all jobs that require LocalToWorld to complete

Hi,

I need to do a hacky callback method in order to make sure my VR rig works properly in ECS. I need to call some code just before the render. However I have a race condition and I need to ensure that all the jobs that are using TransformAspect are completed before I fire this.

I am currently using EntityManager.CompleteAllTrackedJobs(); to finish all jobs but I would prefer something that doesn’t end every job in case I want to have multi frame jobs in the future.

Just looking to do a query on TransformAspect and make sure all those jobs that use that are done. Will save me a lot of time making sure that I don’t have to manually set up dependancies for this one system.

From your description, I believe you could complete dependencies on the specific type (LocalToWorld in this case) that you need to work with.
https://docs.unity3d.com/Packages/com.unity.entities@1.0/api/Unity.Entities.EntityManager.CompleteDependencyBeforeRW.html

1 Like

You are awesome, that is exactly what I needed. I had no idea that existed!

1 Like