Passing NativeHashMap

In the same system I create a NativeHashMap, pass it as NativeHashMap.AsParallelWriter()
and then read it as NativeHashMap. No errors but very strange results. Im i missing something here

var vertexColorMap = new NativeHashMap<int, int>(triangleBuildQueue.Count, Allocator.TempJob);

//JobParallelFor 
FactoryJob = new FillNativeHashMap
{
    //...
    Output = vertexColorMap.AsParallelWriter() // [WriteOnly]
}

//JobParallelFor 
FactoryJob = new ReadNativeHashMap
{
    //...
    Input = vertexColorMap // [ReadOnly]
}

Please elaborate on what the strange results are and we’ll be able to help

It looks like the nativeHashMap changed somewhere unexpectedly and I want to check if passing my nativeHashMap with AsParallelWriter like the example above could be the culprit. I just want to sanity check than I have not gone off the yellow brick road here. Maybe so gotchas I’m not aware of when it comes to AsParallelWriter

Job dependency is not automatically managed for native containers

1 Like

Ok finally found the issues!!, it was indeed a dependency issues , thanks everyone for input