Reputation: 6477
I have a Metal application on iOS where I take video frames and pass each frame through a number of shaders, some are compute shaders applied in multiple passes and 4 of them are independent MTKViews which display computed textures (example, Histogram) along with video preview. Sometimes (but not always) on older hardware such as iPhone 6s, I notice the app has become too sluggish with frame rate dropping to 1 or 2 frames per second. Please let me know how to debug which Metal shaders are clogging the GPU/GPU and how do I optimize the performance of Metal related code.
Upvotes: 0
Views: 1765
Reputation: 8356
drawPrimitives
etc. times in the debug navigator on the left.To view a shader's performance details, select the draw or dispatch call from the event list on the left. There's a "performance" section.
Upvotes: 2