iOS13 SceneKit 错误 - 清除从未释放纹理
iOS13 SceneKit Error – Purging never freed texture
我有一个 ARKit 应用程序可以在 iOS 12.x 上正常运行。在 iOS 13 我在控制台日志中遇到以下错误:
[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>
它每隔几毫秒重复一次,使整个日志变得混乱。我无法缩小它的来源。
有趣的是,即使场景中没有单个节点,也会发生这种情况。如果我从视图中删除整个 sceneView 那么它就会消失......(不是一个选项)
有人知道或提示如何追踪吗?
谢谢
我找到了问题代码行。在 iOS 13 中对
的任何调用
SceneView.snapshot()
产生该错误。苹果文档说:
This method is thread-safe and may be called at any time.
但这似乎在 iOS13 中发生了变化。我将提交错误报告,不希望有快速的解决方案 ;-)
我通过更新场景相机的设置解决了这个问题:
var sceneView: ARSCNView!
...
sceneView.pointOfView?.camera?.wantsHDR = false
希望对您有所帮助。
我有一个 ARKit 应用程序可以在 iOS 12.x 上正常运行。在 iOS 13 我在控制台日志中遇到以下错误:
[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>
它每隔几毫秒重复一次,使整个日志变得混乱。我无法缩小它的来源。
有趣的是,即使场景中没有单个节点,也会发生这种情况。如果我从视图中删除整个 sceneView 那么它就会消失......(不是一个选项)
有人知道或提示如何追踪吗?
谢谢
我找到了问题代码行。在 iOS 13 中对
的任何调用SceneView.snapshot()
产生该错误。苹果文档说:
This method is thread-safe and may be called at any time.
但这似乎在 iOS13 中发生了变化。我将提交错误报告,不希望有快速的解决方案 ;-)
我通过更新场景相机的设置解决了这个问题:
var sceneView: ARSCNView!
...
sceneView.pointOfView?.camera?.wantsHDR = false
希望对您有所帮助。