fix: Fixed racing issues on results of vertex colors and bones jobs. #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes racing issues with vertex colored or skinned models that have submeshes.
Loading this model will currently give two errors and abort the load.

Model: SkinnedVertexColor.zip
Preview:
Platform: Windows, Editor, Runtime loading
Bones issue:
Vertex Color issue:
The cause is trying to reuse the results NativeArray for multiple submeshes, without having the previous job as a dependency.
These changes fixes that. As the submeshes always write to different parts of the NativeArray, I decided to use pointers directly similar to the other vertex jobs instead of adding dependencies to previous job handles.
A semi-related issue is having vertex colors on a skinned model gives this warning:
It still loads fine, but I guess the warning means Unity is doing some extra work behind the scene to fix the streams. I tried to fix it, but couldn't find a solution to that. The same model can be use for testing this issue.