How to reproduce (Issue 1):
1. Open the attached project (“MetalBuffers_Repro.zip“)
2. Build And Run on an iOS device
3. Open Xcode Time Profiler Instrument
4. Profile app for a few seconds
5. Highlight a second of data and expand the hierarchy to see BufferMetal::AllocNewVersionedBuffer
Expected result: This method should take a negligible amount of time
Actual result: This method takes a significant proportion of time (19ms and more)
How to reproduce (Issue 2):
1. Open the Xcode Allocation Instrument
2. Profile app for 10/20 seconds, then press the button in the app to switch to 60 fps target frame rate and profile for 10/20 seconds more
3. Highlight a second of data from the 30 fps section and expand the hierarchy to see BufferMetal::AllocNewVersionedBuffer
4. Compare this to a second of data from the 60 fps section
Expected result: Memory usage should be at most double at 60 fps
Actual result: Memory usage is significantly higher at 60 fps
Reproducible with: 2020.3.37f1, 2021.3.8f1, 2022.1.13f1, 2022.2.0b4, 2023.1.0a5
Reproducible on:
iPhone 13 mini (iOS 16 Public Beta 2)
iPad 6th gen (iOS 14.4.2)