H.D.:
Hi everyone,
I need help on combining native arrays in to a one big array. The scenario is like that.
I need to create some mesh data in different jobs (verts, normals, uvs etc.) There is no problem to create them as I create Nativearray list and send each list item (Nativearray) to jobs to make calculations)
After receiving the data i can apply them to the dynamically created meshes.
But the problem starts here. Assigning the arrays to mesh data is very CPU expensive. I also try to combine these arrays in main thread and then assign to one mesh is also CPU expensive. Combining arrays in main thread taking to much time, even more than assigning separately.
My intention is to add all native arrays into a one big array in another job after completion of mesh data calculation jobs.
I, first created an unsafe list
Then create different jobs (one fore each native array) and in these jobs, add each native array item to big unsafe list. to do this i send same big unsafe list to each job.
When i debugged i saw that the native array items are added to the unsafe list inside the jobs. But when i try to get the unsafe list back in main thread it seems emtpy.
Briefly: I need to combine native array lists in to a big list/array/queue inside jobs.
All comments on this will be appreciated
Thanks in advance.
I Know this is an old reply and my answer is no use. But still. I think you need to pass NativeLust.ParallelWriter into jobs, not the unsafe list itself. Only that way you can write in original list