Search Unity

EntityCommandBuffer.AddSharedComponent containing null being a major Burst roadblock?

Discussion in 'Burst' started by 5argon, Jul 13, 2018.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    I could not use [BurstCompile] on most of my jobs because I have centered my workflow on creating entities with defined ISharedComponentData from a job to communicate with other jobs. The problem being AddSharedComponent code containing the use of null. I wonder if we can optimize this so that it is Burst compatible?

    Code (CSharp):
    1.  
    2. /Users/Sargon/Library/Unity/cache/packages/staging-packages.unity.com/com.unity.entities@0.0.12-preview.8/Unity.Entities/EntityCommandBuffer.cs(423,9): error: Using managed `null` is not supported by burst
    3.  
    4. While processing function `System.Void Unity.Entities.EntityCommandBuffer::AddSharedComponent<T>(Unity.Entities.Entity,T)`
    5.  
    6. While compiling job: System.Void Unity.Jobs.IJobExtensions/JobStruct`1<SectionSystem/SectionJob>::Execute(T&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
     
    GilCat likes this.
  2. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    This would actually be great. By the way I only get those Burst errors when running on MacOS. Windows seems to bypass it.