Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Did something change wrt NativeList.AsDeferredJobArray() in 2021.2.8 and 2022.1.x?

Discussion in '2022.1 Beta' started by burningmime, Jan 18, 2022.

  1. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    615
    I've tracked down a major bug to a NativeArray being empty that is assigned from a NativeList AsDeferredJobArray. This works fine in 2021.2.7, but starting in 2021.2.8 and 2022.x, the array is always empty even though I filled list up in a previous job.

    I can submit a repro but before I do, I want to be sure I'm not missing something fundamental that's changed re: the API
     
  2. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    615
    Also, NativeList.AsArray() stopped working for Temp-allocated lists from within jobs (safety check throws exceptions even on calls to GetLength() thinking it's disposed). Not sure if related. Plus, Collections package 1.1.0 is throwing a constant stream of warnings at my console:

    upload_2022-1-18_14-55-40.png

    I feel like there's been some major shifts to collections/native list under the hood in 2021.2.08 which also affects 2022. I *think* I fixed all the crashes in my project, but this doesn't really give me confidence that the collections package was ready for 1.0.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,022
  4. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    615