I have had a look at this thread:
How does IJobNativeMultiHashMapMergedSharedKeyIndices work? ,
but it unfortunately did not answer my question fully.
It actually extended my question to asking about a piece of code in the boid sample in particular:
public void ExecuteFirst(int index)
{
var position = cellSeparation[index].Value / cellCount[index];
...
}
public void ExecuteNext(int cellIndex, int index)
{
cellCount[cellIndex] += 1;
...
cellIndices[index] = cellIndex;
}
I was wondering how the cellCount is used in Executefirst (for the first index), if at this point it will have just been initialised to 1 (following from the video) making the division redundant. It is however changed in ExecuteNext (again affecting first index). I was wondering if the ExecuteNext actually affects the outcome of ExecuteFirst, as the value is seemingly used before in ExecuteFirst. I probably just misunderstood the working of this particular Job and would get some clarification. Hopefully someone will be able to help me and thanks a lot.