Search Unity

Resolved NativeSetClassTypeToNullOnSchedule not working with burst

Discussion in 'Burst' started by kadd11, Sep 15, 2021.

  1. kadd11

    kadd11

    Joined:
    Mar 11, 2018
    Posts:
    33
    Hi,

    I have a managed field in a struct which is used in a job. However, I don't use the managed object in the job, and I have it tagged with NativeSetClassTypeToNullOnSchedule, however, burst still complains with:
    Code (CSharp):
    1.  Burst error BC1051: Invalid managed type found for the field
    The one difference I see between this and the DisposeSentinel used in all of the native collections is that the managed type I am using is generic. Is this not supported?
     
  2. MarcoPersson

    MarcoPersson

    Unity Technologies

    Joined:
    Jul 21, 2021
    Posts:
    53
    Hello kadd11, when using a struct from Burst all members of that struct must not be managed.
    DisposeSentinel is an exception to this rule, because it's a special case in the way it's handled by Burst.
     
    kadd11 likes this.