Cannot debug shaders compiled on Windows

I'm using shaders compiled with Metal Developer Tools for Windows. Compiled shaders look fine, but cannot see the shader source from GPU frame capture in Xcode, and cannot debug these shaders. (I tried options "-MO" and "-gline-tables-only", but nothing changed.)

Could you tell me how can I debug the shaders compiled on Windows?

Below is my environment.

  • Mac mini (M1, 2020)
  • Xcode 12.5.1
  • Metal Developer Tools for Windows 1.2

Hi, I think you need to add the "record-sources" flag with the "flat" option.

Thank you for trying with beta 5.

For saving sources to a .metallibsym file, please see this article.

For saving sources to a .metallib file, please use metal -frecord-sources without =flat.

If the commands described above do not result in Xcode 13 beta 5 displaying your sources, it would be helpful to detail all your steps in a Feedback Assistant request.

This doesn't work for me. I've tried with both frecord-sources and the flat equivalent, and the older -MO flag as well. With both the latest beta & release versions of the metal developer tools and with latest xcode release 13.2.1

When loading it into xcode frame debugger, it shows "No source" and if I look at the filepath of the lib it shows the path on windows. Could that be the reason ? I assume the source should be embedded and it shouldn't care about the filepath of the original metal file.

Thanks

If you use the flat option, then according to this article, it will result in a companion .metallibsym file. That is the file that Xcode will ask for. Since the original path was on Windows, and you're debugging on Mac, then you would need to add a path to the directory where this file is located on your Mac. You can do this by clicking the Add button (+) in the Import External Sources dialog.

Cannot debug shaders compiled on Windows
 
 
Q