Metal frame capture issues

I'm not sure if this is somehow a cadence issue or something. If I attempt to use the stylized M button in Xcode to kick off a GPU capture on iOS it seems to just go on forever capturing command buffers instead of exiting when we swap to the next display surface.

We are presenting the current drawable with presentDrawable and invoking nextDrawable on the MetalLayer (but note that we are doing this by extending it to be supported from C++).

If I trigger and end the capture myself it works fine, and so that works for now, but I'm curious if I'm doing something wrong that causes it not to recognize the end of frame correctly for the Xcode GUI version.

Metal frame capture issues
 
 
Q