shader debugger - unable to find library source

Hi,


Xcode's Metal shader debugger hasn't been working for me for a while now. I think it started around Catalina beta, then worked for a day or two at some point, and then again not. It is simply dysfunctional and I have no clue what's up with that.


Xcode can capture frames, show texture data, commandbuffer graphs etc, but when you proceed to debug a shader (click the bug icon somewhere) it pops an error in a popup:


Error DYPShaderDebuggerErrorDomain:1: Unable to find library source.Library source required.

Under the target's Build Settings, ensure the Metal Compiler Build Options produces debugging information and includes source code.

If building with the 'metal' command line tool, add the options '-gline-tables-only' and '-MO' to your compilation step.

(can't attach a screenshot here, does this forum run on iOS 13?)


The error popup suggests to make sure Metal debugging flags are enabled in the target build settings, of course these are enabled (they are enabled by default).


It doesn't matter which project I open, including Metal sample code from Apple.


  • is this maybe just my machine? some stray config files somewhere, breaking things? Does the Metal Shader Debugger work for you?
  • what gives?


mac mini 2018, latest macOS / Xcode etc.

Accepted Reply

ok, immediately after posting this I found the issue and a fix here:

https://forums.raywenderlich.com/t/debug-shader-unable-to-create-shader-debug-session/56885/4


in Xcode Settings > Locations, Command Line Tools wasn't set (this probably got messed up during this year's beta phase). Choosing the Xcode 11.2.1 Command Line Tools there fixed it.

Replies

ok, immediately after posting this I found the issue and a fix here:

https://forums.raywenderlich.com/t/debug-shader-unable-to-create-shader-debug-session/56885/4


in Xcode Settings > Locations, Command Line Tools wasn't set (this probably got messed up during this year's beta phase). Choosing the Xcode 11.2.1 Command Line Tools there fixed it.