RealityKit entity cloning doesn't appear to instance mesh resource

Originator:jackmousseau
Number:rdar://FB8912817 Date Originated:November 22nd, 2020
Status:Open Resolved:
Product:RealityKit Product Version:
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
# Overview

The `clone(recursive:)` documentation states: 

`Resource`s referenced in components are not duplicated. (Resources can be shared between entities.)

However, when an entity with a mesh resource is cloned, the mesh appears to be duplicated.

## Attachments

The attached zip file contains a sample Ball Pit application and iPhone 12 Pro screen recording. The application adds a ball entity to the scene when the screen is tapped. After adding approximately 100 ball entities to the scene, the app's memory footprint increases by 40 MB. This memory increase combined with a one-to-one entity, draw call mapping suggests geometry is not shared between cloned entities. Based on the documentation, I would expect `MeshResource`s to be shared.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!