Search Unity

[FIXED in Burst 1.0.0 preview 9]Does Burst Compiler support System.Boolean (bool) type ?

Discussion in 'Burst' started by PhuongND, Apr 1, 2019.

  1. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    I have a job like this :

    Code (CSharp):
    1. [BurstCompile]
    2.     struct CopyUnitHasTarget : IJobProcessComponentDataWithEntity<TargetComponentData>
    3.     {
    4.         public NativeArray<bool> UnitHasTarget;
    5.  
    6.         public void Execute(Entity entity, int index,[ReadOnly] ref TargetComponentData targetComponentData)
    7.         {
    8.             if (targetComponentData.Target.Index > 0)
    9.                 UnitHasTarget[index] = true;
    10.             else
    11.                 UnitHasTarget[index] = false;
    12.         }
    13.     }
    While running, Burst compiler show out a error :

    Unexpected exception Burst.Compiler.IL.CompilerException: Error while verifying module: Stored value type does not match pointer operand type!
    store i32 %value, i8* %2, align 1
    i8
    at Burst.Compiler.IL.NativeCompiler.Compile () [0x00329] in <f907ae19e5b345699b43ba957911d6bb>:0
    at Burst.Compiler.IL.Jit.JitCompiler.CompileMethod (Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Jit.JitOptions jitOptions) [0x001b6] in <f907ae19e5b345699b43ba957911d6bb>:0
    at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x002bc] in <f907ae19e5b345699b43ba957911d6bb>:0
    While compiling job: System.Void Unity.Entities.JobProcessComponentDataExtensions/JobStruct_Process_ED`2<BaseUnitJobSystem/CopyUnitHasTarget,TargetComponentData>::Execute(Unity.Entities.JobProcessComponentDataExtensions/JobStruct_Process_ED`2<T,U0>&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)



    I suppose that Burst compiler doesn't support bool type , I am using Unity 2019.2.0a9 + Burst 1.0.0.preview4
     
  2. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Can you check with latest Burst `1.0.0.preview8+` as we had recently an issue with nested conditionals
     
  3. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    thanks for your reply. How can I update to lastet Burst ? I can not update with Package Manager
     
  4. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    I am using Unity 2019.2.0a9 and i've upgraded just fine. If not try clearing you cache (delete Library folder)
     
  5. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    I have to remove both Library + Packages folder, then Install Burst package before install Entities Package. thanks
     
  6. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    I've upgraded to Burst 1.0.0 preview8 but still got same error
     
  7. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Ok, we are going to have a look asap
     
    FROS7 likes this.
  8. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
  9. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The blittable constraint for NativeArray has been lifted in 19.1. It is instead only requiring Unmanaged, meaning bool should work. The burst issue is being looked at.
     
  10. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    This is fixed, we have a new burst version 1.0.0 preview9 in preparation, will ping you back here when it is available
     
    siggigg and GilCat like this.
  11. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    Thanks , nice work!
     
  12. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    1.0.0-preview.9 is up, let me know if it is fixing your issue
     
  13. PhuongND

    PhuongND

    Joined:
    Dec 30, 2013
    Posts:
    30
    Yes It's be fixed!!!
     
  14. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    In this context, doesn't that mean that we could perform a job on NativeArray<NativeArray<T>>? is NativeArray a managed or unmanaged type?

    It doesn't seem to work
     
  15. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    NativeArray contains a managed reference for leak detection. So nesting them is not possible.