What should be the "jobIndex" for EntityCommandBuffer in IJobChunk?

Hi,

I’ve a question on the jobIndex parameter for EntityCommandBuffer.

The manual tells we should use “index” when use IJobParallelFor,

For performance reasons, jobIndex should be the (increasing) index values passed to IJobParallelFor.Execute()```

But when in IJobChunk, should we use the chunkIndex for the whole chunk job, or use incremented entity index for each entity?

Chunk index.

It needs to be unique per thread which the index will be.

1 Like

Or use thread index field with attribute [NativeSetThreadIndex] (on mobile, don’t remember exact syntax)