glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Warnings when loading draco compressed meshes

Open anonymous2585 opened this issue 7 months ago • 0 comments

Describe the bug When loading a big glb that is draco compressed, the following warnings can appear in the console:

Internal: JobTempAlloc has allocations that are more than the maximum lifespan of 4 frames old - this is not allowed and likely a leak
Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 10)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Unity.Collections.NativeArray`1<Unity.Mathematics.float3>:Dispose ()
Draco.DracoNative:CreateBounds () (at ./Library/PackageCache/com.unity.cloud.draco/Runtime/Scripts/DracoNative.cs:468)
Draco.DracoDecoder/<DecodeMesh>d__15:MoveNext () (at ./Library/PackageCache/com.unity.cloud.draco/Runtime/Scripts/DracoDecoder.cs:366)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetResult ()
Draco.DracoDecoder/<WaitForJobHandle>d__16:MoveNext () (at ./Library/PackageCache/com.unity.cloud.draco/Runtime/Scripts/DracoDecoder.cs:389)
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()

The "age" of the allocation varies from 5 to 11.

Issue is in the com.unity.cloud.draco package.

To Reproduce Steps to reproduce the behavior:

  1. Load at runtime a big draco glb with a defered agent
  2. See the warning in the console (may no happen everytime)

Expected behavior No warning are thrown.

Desktop:

  • glTFast version 6.7.0
  • Unity Editor version 6000.0.11f1
  • Render Pipeline and version Universal Render Pipeline 17.0.3
  • Platform: Editor, Windows Player

Additional context

Changing allocator in m_PositionMinMax = new NativeArray<float3>(2, Allocator.TempJob); (line 289 of DracoNative.cs) to Allocator.Persistent solves the issue.

anonymous2585 avatar Jul 24 '24 08:07 anonymous2585