Chris
Chris

Reputation: 1447

iOS13 SceneKit Error – Purging never freed texture

I have an ARKit app that runs fine on iOS 12.x. On iOS 13 I encounter the following error in the console log:

[SceneKit] Error: Purging never freed texture <AGXA9FamilyTexture: 0x11d688240>
    label = <none> 
    textureType = MTLTextureType2D 
    pixelFormat = MTLPixelFormatR16Float 
    width = 240 
    height = 1 
    depth = 1 
    arrayLength = 1 
    mipmapLevelCount = 1 
    sampleCount = 1 
    cpuCacheMode = MTLCPUCacheModeDefaultCache 
    storageMode = MTLStorageModePrivate 
    hazardTrackingMode = MTLHazardTrackingModeTracked 
    resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModePrivate MTLResourceHazardTrackingModeTracked  
    usage = MTLTextureUsageShaderRead MTLTextureUsageShaderWrite 
    shareable = 0 
    framebufferOnly = 0 
    purgeableState = MTLPurgeableStateNonVolatile 
    swizzle = [MTLTextureSwizzleRed, MTLTextureSwizzleGreen, MTLTextureSwizzleBlue, MTLTextureSwizzleAlpha] 
    isCompressed = 0 
    parentTexture = <null> 
    parentRelativeLevel = 0 
    parentRelativeSlice = 0 
    buffer = <null> 
    bufferOffset = 512 
    bufferBytesPerRow = 0 
    allowGPUOptimizedContents = YES
    label = <none>

It repeats every few milliseconds and clutters the whole log. I was not able to narrow down where it comes from.

The interesting part is, that this even occurs when not a single node is present in the scene. If I remove the entire sceneView from the view then it disappears...(not an option)

Anybody any idea or hint how to track this down ?

Thanks

Upvotes: 0

Views: 269

Answers (2)

MattPatrik
MattPatrik

Reputation: 36

I fixed this issue by updating the setting of the scene camera:

var sceneView: ARSCNView!
...
sceneView.pointOfView?.camera?.wantsHDR = false

Hope this helps.

Upvotes: 1

Chris
Chris

Reputation: 1447

I have found the problem code line. In iOS 13 any call to

SceneView.snapshot()

produces that error. The apple docs say:

This method is thread-safe and may be called at any time.

but this seems to have changed in iOS13. I will file a bug report not hoping for a fast solution ;-)

Upvotes: 0

Related Questions