Search Unity

Resolved Android il2cpp Hybrid Render V2 error

Discussion in 'Graphics for ECS' started by zhoupwrd, Aug 5, 2021.

  1. zhoupwrd

    zhoupwrd

    Joined:
    Jan 6, 2021
    Posts:
    12
    env:
    Unity 2020.3.9f1
    "com.unity.platforms.android": "0.10.0-preview.10"
    "com.unity.rendering.hybrid": "0.11.0-preview.44"
    "com.unity.render-pipelines.universal": "10.5.1"
    project is URP template
    mono is ok,but il2cpp is not work
    error log:
    08-05 19:33:58.613 17088 17105 E Unity : InvalidOperationException: The NativeArray can not be Disposed because it was not allocated with a valid allocator.
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Collections.NativeArray`1[T].Dispose (Unity.Jobs.JobHandle inputDeps) [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Rendering.HybridRendererSystem.UpdateAllBatches (Unity.Jobs.JobHandle inputDependencies) [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Rendering.HybridRendererSystem.UpdateHybridV2Batches (Unity.Jobs.JobHandle inputDependencies) [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Rendering.HybridRendererSystem.OnUpdate (Unity.Jobs.JobHandle inputDeps) [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Entities.JobComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at Unity.Entities.ComponentSystem.Update () [0x00000] in <00000000000000000000000000000000>:0
    08-05 19:33:58.613 17088 17105 E Unity : at UnityEngine.LowLeve
     
  2. VincentBreysse

    VincentBreysse

    Unity Technologies

    Joined:
    May 31, 2021
    Posts:
    27
    Please could you send a bug report with a repro case so that we can investigate it? Thanks
     
  3. zhoupwrd

    zhoupwrd

    Joined:
    Jan 6, 2021
    Posts:
    12
    Case 1357551, I Try send a bug report with a repro case,but upload always error, so just with some steps for reproduce:
    1)Create proj from Unity 2020.3.9f1 URP template
    2)allow preview package
    3)update com.unity.render-pipelines.universal from 10.5.0 to 10.5.1
    4)add com.unity.rendering.hybrid:0.11.0-preview.44
    5)add com.unity.platforms.android:0.10.0-preview.10
    6)change Scripting Backend from mono to il2cpp
    7)add Scripting Define Symbols ENABLE_HYBRID_RENDERER_V2
    8)In Assets, create build config:AndroidClassicBuildConfiguration
    9)build and run on Android & logcat
     
  4. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    130
    Yes, I've the same error

    My device is Samsun S20+
     
  5. zhoupwrd

    zhoupwrd

    Joined:
    Jan 6, 2021
    Posts:
    12
  6. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    We have tracked this down partly and it looks like it is potentially a compiler bug.
    You can probably work around this by tagging UpdateAllBatches to not be optimized


    Code (CSharp):
    1.         #if UNITY_ANDROID && !UNITY_64
    2.         [MethodImpl(MethodImplOptions.NoOptimization)]
    3.         #endif
    4.         public JobHandle UpdateAllBatches(JobHandle inputDependencies)
    We will land this workaround in a future hybrid renderer package while we try to find the root cause.
     
  7. zhoupwrd

    zhoupwrd

    Joined:
    Jan 6, 2021
    Posts:
    12
    Good job!!! Its work.
     
    joelv likes this.
  8. maxostrach

    maxostrach

    Joined:
    Apr 8, 2020
    Posts:
    9
    Was this ever fixed? I think I'm having a similar problem but I can't find the solution. How do I implement this change?
     
  9. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    I think it has been fixed, however there has been no package released with the fix yet.
    I'll have a look at the branches to ensure this fix has made it there once I get back from vacation
     
  10. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    OmarVector, Lukas_Kastern and Thermos like this.
  11. linfuqing

    linfuqing

    Joined:
    May 11, 2015
    Posts:
    166
  12. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
  13. linfuqing

    linfuqing

    Joined:
    May 11, 2015
    Posts:
    166
  14. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    I see that but the problem is that reports some way down in a forum post is hard to track. It's much better for both you and us to work with a regular bug report with repro projects. We can all then see if it gets fixed or not and what versions the fix ends up in.
     
    linfuqing likes this.