Search Unity

[Solved] 2020.1.0b3 - Build - Runtime errors in HybridRenderer

Discussion in 'Graphics for ECS' started by Enzi, Mar 31, 2020.

  1. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    966
    I get these errors every frame in a build. It's working fine in editor:
    Code (CSharp):
    1.  
    2. AssertionException: Assertion failure. Value was False
    3. Expected: True
    4.   at UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) [0x00043] in <cf2e2e90a80f4d1a92021a850f1df75a>:0
    5.   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) [0x0000f] in <cf2e2e90a80f4d1a92021a850f1df75a>:0
    6.   at UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition) [0x00009] in <cf2e2e90a80f4d1a92021a850f1df75a>:0
    7.   at Unity.Assertions.Assert.IsTrue (System.Boolean condition) [0x00008] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\Stubs\Unity.Assertions\Assert.cs:15
    8.   at Unity.Entities.ManagedComponentStore.RemoveReference (System.Int32 index, System.Int32 numRefs) [0x00032] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ManagedComponentStore.cs:333
    9.   at Unity.Entities.ManagedComponentStore.Playback (Unity.Entities.ManagedDeferredCommands& managedDeferredCommands) [0x0009a] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ManagedComponentStore.cs:634
    10.   at Unity.Entities.EntityCommandBuffer.ProcessTrackedChanges (EntityDataAccess* mgr, Unity.Collections.LowLevel.Unsafe.UnsafeList* managedReferenceIndexRemovalCount, Unity.Entities.EntityComponentStore+ArchetypeChanges& archetypeChanges) [0x00019] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\EntityCommandBuffer.cs:1904
    11.   at Unity.Entities.EntityCommandBuffer.PlaybackInternal (EntityDataAccess mgr) [0x00485] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\EntityCommandBuffer.cs:1363
    12.   at Unity.Entities.EntityCommandBuffer.Playback (Unity.Entities.EntityManager mgr) [0x00014] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\EntityCommandBuffer.cs:1189
    13.   at Unity.Entities.ComponentSystem.AfterOnUpdate () [0x0000e] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystem.cs:79
    14.   at Unity.Entities.ComponentSystem.Update () [0x00054] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystem.cs:115
    15.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x0002b] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:134
    16. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    17. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    18. UnityEngine.Logger:LogException(Exception, Object)
    19. UnityEngine.Debug:LogException(Exception)
    20. Unity.Debug:LogException(Exception) (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\Stubs\Unity\Debug.cs:19)
    21. Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:138)
    22. Unity.Entities.ComponentSystemGroup:OnUpdate() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:114)
    23. Unity.Entities.ComponentSystem:Update() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystem.cs:108)
    24. Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ScriptBehaviourUpdateOrder.cs:152)
    25. (Filename: <cf2e2e90a80f4d1a92021a850f1df75a> Line: 0)
    26.  
    Anyone else has this or knows how to debug?
    Packages Manifest:
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.sprite": "1.0.0",
    4.     "com.unity.burst": "1.3.0-preview.8",
    5.     "com.unity.entities": "0.8.0-preview.8",
    6.     "com.unity.ide.visualstudio": "2.0.0",
    7.     "com.unity.platforms": "0.2.1-preview.8",
    8.     "com.unity.platforms.windows": "0.2.1-preview.8",
    9.     "com.unity.render-pipelines.universal": "8.0.1",
    10.     "com.unity.rendering.hybrid": "0.3.3-preview.11",
    11.     "com.unity.scriptablebuildpipeline": "1.6.5-preview",
    12.     "com.unity.test-framework.performance": "2.0.9-preview",
    13.     "com.unity.textmeshpro": "3.0.0-preview.1",
    14.     "com.unity.timeline": "1.3.1",
    15.     "com.unity.ugui": "1.0.0",
    16.     "com.unity.visualeffectgraph": "8.0.1",
    17.     "com.unity.xr.legacyinputhelpers": "2.0.2",
    18.     "com.unity.modules.ai": "1.0.0",
    19.     "com.unity.modules.androidjni": "1.0.0",
    20.     "com.unity.modules.animation": "1.0.0",
    21.     "com.unity.modules.assetbundle": "1.0.0",
    22.     "com.unity.modules.audio": "1.0.0",
    23.     "com.unity.modules.cloth": "1.0.0",
    24.     "com.unity.modules.director": "1.0.0",
    25.     "com.unity.modules.imageconversion": "1.0.0",
    26.     "com.unity.modules.imgui": "1.0.0",
    27.     "com.unity.modules.jsonserialize": "1.0.0",
    28.     "com.unity.modules.particlesystem": "1.0.0",
    29.     "com.unity.modules.physics": "1.0.0",
    30.     "com.unity.modules.physics2d": "1.0.0",
    31.     "com.unity.modules.screencapture": "1.0.0",
    32.     "com.unity.modules.terrain": "1.0.0",
    33.     "com.unity.modules.terrainphysics": "1.0.0",
    34.     "com.unity.modules.tilemap": "1.0.0",
    35.     "com.unity.modules.ui": "1.0.0",
    36.     "com.unity.modules.uielements": "1.0.0",
    37.     "com.unity.modules.umbra": "1.0.0",
    38.     "com.unity.modules.unityanalytics": "1.0.0",
    39.     "com.unity.modules.unitywebrequest": "1.0.0",
    40.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    41.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    42.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    43.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    44.     "com.unity.modules.vehicles": "1.0.0",
    45.     "com.unity.modules.video": "1.0.0",
    46.     "com.unity.modules.vr": "1.0.0",
    47.     "com.unity.modules.wind": "1.0.0",
    48.     "com.unity.modules.xr": "1.0.0"
    49.   }
    50. }
    51.  
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Just small note - all safety checks and leak detection enabled if you profile in editor instead of build? Sometimes I'm disable them and forgot reenable :)
     
  3. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    966
    Does it make a difference for the build if all the safety checks are enabled or not?
    Anyway, I tried it with both and I'm not picking up any errors in the editor.

    The problem is probably on my side but I'm having no indicators what to debug as the error message is kind of generic. From the place it throws errors I can only deduct that it has something to do with SharedComponents (maybe).
     
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    I told not about build but about editor and checks, as possibility of maybe you forgot enable them and editor can suppress errors.
    This is what I was interested :)
     
  5. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    966
    Seemed like a follow up error. I've reduced it now to an error in HybridRenderer:
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3.   at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <437ba245d8404784b9fbab9b439ac908>:0
    4.   at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <437ba245d8404784b9fbab9b439ac908>:0
    5.   at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <437ba245d8404784b9fbab9b439ac908>:0
    6.   at Unity.Entities.ManagedComponentStore.GetSharedComponentData[T] (System.Int32 index) [0x00015] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ManagedComponentStore.cs:296
    7.   at Unity.Entities.EntityManager.GetSharedComponentData[T] (System.Int32 sharedComponentIndex) [0x00001] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\EntityManagerAccessComponentData.cs:217
    8.   at Unity.Rendering.InstancedRenderMeshBatchGroup.AddBatch (Unity.Rendering.FrozenRenderSceneTag tag, System.Int32 rendererSharedComponentIndex, System.Int32 batchInstanceCount, Unity.Collections.NativeArray`1[T] chunks, Unity.Collections.NativeArray`1[T] sortedChunkIndices, System.Int32 startSortedIndex, System.Int32 chunkCount, System.Boolean flippedWinding, Unity.Entities.EditorRenderData data) [0x00030] in H:\MG\Library\PackageCache\com.unity.rendering.hybrid@0.3.3-preview.11\Unity.Rendering.Hybrid\InstancedRenderMeshBatchGroup.cs:713
    9.   at Unity.Rendering.RenderMeshSystemV2.CacheMeshBatchRendererGroup (Unity.Rendering.FrozenRenderSceneTag tag, Unity.Collections.NativeArray`1[T] chunks, System.Int32 chunkCount) [0x001ec] in H:\MG\Library\PackageCache\com.unity.rendering.hybrid@0.3.3-preview.11\Unity.Rendering.Hybrid\RenderMeshSystemV2.cs:199
    10.   at Unity.Rendering.RenderMeshSystemV2.UpdateDynamicRenderBatches () [0x00043] in H:\MG\Library\PackageCache\com.unity.rendering.hybrid@0.3.3-preview.11\Unity.Rendering.Hybrid\RenderMeshSystemV2.cs:279
    11.   at Unity.Rendering.RenderMeshSystemV2.OnUpdate (Unity.Jobs.JobHandle inputDeps) [0x00044] in H:\MG\Library\PackageCache\com.unity.rendering.hybrid@0.3.3-preview.11\Unity.Rendering.Hybrid\RenderMeshSystemV2.cs:297
    12.   at Unity.Entities.JobComponentSystem.Update () [0x00069] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\JobComponentSystem.cs:129
    13.   at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x0002b] in H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:134
    14. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    15. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    16. UnityEngine.Logger:LogException(Exception, Object)
    17. UnityEngine.Debug:LogException(Exception)
    18. Unity.Debug:LogException(Exception) (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\Stubs\Unity\Debug.cs:19)
    19. Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:138)
    20. Unity.Entities.ComponentSystemGroup:OnUpdate() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystemGroup.cs:114)
    21. Unity.Entities.ComponentSystem:Update() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ComponentSystem.cs:108)
    22. Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at H:\MG\Library\PackageCache\com.unity.entities@0.8.0-preview.8\Unity.Entities\ScriptBehaviourUpdateOrder.cs:152)
    Will try another version of HybridRenderer.

    edit: Eh, same error with HybridRenderer 0.4.0 preview8 :(
     
    Last edited: Mar 31, 2020
  6. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    966
    Bump
    Noone else having these errors with Hybrid Renderer? I'm pretty stuck on this.

    edit:
    Good news, it had nothing to do with Hybrid Renderer and was a cascading error that just ended with hybrid renderer tripping up.
    The codebase is quite old and I didn't realized a try/catch with no output/code in catch, was calling EntityManager.GetComponentObject<Animator>(animEvent.entity) which resulted in errors because instanced entities don't have an animator in ECS world.

    Easy fix, but I'm still under the impression that this should not trip up the whole system. The editor didn't care, same should be with builds. Sucks when there's no stability parity and you're never quite sure.
     
    Last edited: Apr 3, 2020