Search Unity

Generics job error after Entities p32 with Burst

Discussion in 'Burst' started by GilCat, May 23, 2019.

  1. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
    After updating to Entities p32 i started getting the error:
    error: Unable to find interface method `Unity.Entities.IJobForEach_CC`2<T0,T1>.Execute(ref T0, ref T1)` from type

    This error only happens if Burst is enabled no matter what version of Burst i try and only in Entities p32.
    Also the Job must have 2 or more generic types.

    Here is a system that illustrates the problem:
    Code (CSharp):
    1. public class MySystem : JobComponentSystem {
    2.  
    3.   [BurstCompile]
    4.   struct GenericJob1<T1> : IJobForEach<T1>
    5.   where T1 : struct, IComponentData {
    6.  
    7.     public void Execute(ref T1 v1) {
    8.       /// Do something here
    9.     }
    10.   }
    11.  
    12.   [BurstCompile]
    13.   struct GenericJob2<T1, T2> : IJobForEach<T1, T2>
    14.     where T1 : struct, IComponentData
    15.     where T2 : struct, IComponentData {
    16.  
    17.     public void Execute(ref T1 v1, ref T2 v2) {
    18.       /// Do something here
    19.     }
    20.   }
    21.  
    22.   protected override JobHandle OnUpdate(JobHandle inputDeps) {
    23.     // Works fine
    24.     inputDeps = new GenericJob1<Translation>()
    25.       .Schedule(this, inputDeps);
    26.     // Causes Exception
    27.     inputDeps = new GenericJob2<Translation, Rotation>()
    28.       .Schedule(this, inputDeps);
    29.     return inputDeps;
    30.   }
    31. }
     
  2. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Thanks for the report, we will have a look at this issue
     
    GilCat likes this.