glTFast
glTFast copied to clipboard
Warnings when loading draco compressed meshes
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:
- Load at runtime a big draco glb with a defered agent
- 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.