0
\$\begingroup\$

So it seems that the ECS supplies a job type for modifying transforms in parallel chunks, albeit not burst-compatible. However, you have to build the TransformAccessArray first. The issue here being that acquisition of the transforms to fill the collection seems as if it must be done explicitly on the main thread. Am I correct in this assumption? Meaning that while we can parallelize the actual transform manipulation, the operations required to actually put them in the TransformAccessArray seem to not benefit at all from the ECS architecture. But today is like, day three for me in regards to using the ECS, so I would appreciate it if someone could confirm this is true before I decide how to go about building this.

The order of operations essentially goes like:

  1. Filter entities via query
  2. Parallelized population of native container with entities' derived component that stores position
  3. Population of transform access array with entities' derived component object that stores transform
  4. Parallelized (via IJobParallelForTransform) modification of transforms (in access array)

So, it would seem, that this process has a stumbling block in the middle. It would be much more efficient if we could acquire these transforms in parallelized chunks.

The operation I would like to parallelize: (or something that has the same outcome)

Transform transform = EntityManager.GetComponentObject<Transform>(entity);
transformAccessArray.Add(transform);

I'm kind of assuming we can't, given the main-thread restrictions we have for game objects, but I was hoping someone could confirm or deny whether or not it's possible to do this in parallel.

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .