Memory leaks after using subdivisionLevel

SCNGeometry.subdivisionLevel still results in memory leaks, apparently in the OpenSubdiv library used for subdivision.


Steps to Reproduce: Set the subdivisionLevel property of a SCNGeometry of any SCNNode to more than the default 0. That's all there is to it. For example on the airplane model in the SceneKit template. Using the subdivision method for MDLMesh results in the same leaks (obviously because it also used OpenSubdiv). If the subdivisionLevel is set back to 0 and then to anything higher than 0 it will leak again. With more than a few models it quickly adds up.


SCNGeometry.subdivisionLevel was introduced in WWDC 2014 and 3 years later it is still leaking, so I submitted this as a bug report. Can someone tell me if I should expect a reply and can count on this being fixed?

Answered by Xartec in 277789022

Adding these two lines will cause the subdivision to be performed on the GPU instead of the CPU and will prevent the memory leaks.


let tess = SCNGeometryTessellator()

geometry.tessellator = tess

Accepted Answer

Adding these two lines will cause the subdivision to be performed on the GPU instead of the CPU and will prevent the memory leaks.


let tess = SCNGeometryTessellator()

geometry.tessellator = tess

Memory leaks after using subdivisionLevel
 
 
Q