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. The 2022.2 beta is now available for testing. To find out what's new, have a look at our 2022.2 feature highlights.
    Dismiss Notice
  3. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  4. 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
Dismiss Notice
Submit bug reports tagged with #Beta2022Win_Unity when you encounter unknown issues while testing the 2022.2 betas for a chance to win a year of Unity Pro. For more information, have a look at our Beta Sweepstakes Announcement.

Bug ParallelWritter to methods with codegen inside from OnUpdate (Entities 0.51.0, DOTS team aware)

Discussion in 'Data Oriented Technology Stack' started by eizenhorn, Jun 23, 2022.

  1. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,436
    Just for community to aware (Unity already know and created ticket for that).

    Passing
    ParallelWritter
    to methods with codegen inside (
    Entities.ForEach
    ,
    Job.WithCode
    ) from
    OnUpdate
    will crash ILPP cloner:
    upload_2022-6-23_19-13-44.png

    Simple repro:
    Code (CSharp):
    1.  
    2. public partial class SimpleCompilerCrash : SystemBase
    3. {
    4.    protected override void OnUpdate()
    5.    {
    6.        BreakingMethod(new NativeList<int>(Allocator.Temp).AsParallelWriter());
    7.    }
    8.  
    9.    private void BreakingMethod(NativeList<int>.ParallelWriter listParallel)
    10.    {
    11.        Job.WithCode(() => { }).Schedule();
    12.    }
    13. }
    14.  
    The issue:
    If you look at
    Method candidates are
    you'll see in method signature missed
    .ParallelWriter

    upload_2022-6-23_19-14-55.png

    Workaround:
    Put arguments for method into wrapper struct and pass this struct to method.
     
    Last edited: Jun 23, 2022
unityunity