Debug View Hierarchy not showing Metal content

The "Debug View Hierarchy" feature of Xcode is very convenient to break down and debug a complex view hierarchy. But Metal content/layers/views do not render anything in this mode.

Is there some special flag that needs to be set on the layer to support the Xcode feature? Or some special callback that needs to be implemented?

I would naively assume that Xcode could do some kind of read-back from the window server or GPU, even for layers rendered via accelerated APIs like Metal or OpenGL, similar to what's done when recording/capturing the screen.

Filed as FB13509137

  • Thanks for filing FB13509137.

Add a Comment

Replies

Hi. While the View Debugger does not render content for Metal views (thanks for filing FB13509137), you can access properties for CAMetalLayer or MTKView views in the Inspector (see screenshot attached)

For more in depth Metal debugging, you can also capture your app using the Metal Debugger.

  • Nice, that helps to see the properties! Unfortunately we use a CAMetalLayer in an NSView, not MTKView, so we're not seeing those properties shown in the screenshot above. Is there a way to drill down in the inspector from a NSView to its layer?

Add a Comment