Say I have a struct and 2 jobs like this:
struct Vertex
{
public float3 position;
public float2 uv;
}
struct ColliderJob : IJob
{
[ReadOnly] public NativeArray<Vertex> vertices;
[WriteOnly] public NativeReference<PMeshCollider> output;
public void Execute() { /* read from position, ignore UV, write to output */ }
}
struct UVJob : IJob
{
public NativeArray<Vertex> vertices;
public void Execute() { /* read from position, write to UV */ }
}
These jobs should be able to run in parallel since the ColliderJob does not read from the UV field, which is the only thing the UVJob will modify. However the safety system (rightly) complains since I am actually modifying the contents of an array while in use by another job. Is there a way to tell the safety system to just take a chill pill for a bit and not make these jobs depend on one another?