gfx icon indicating copy to clipboard operation
gfx copied to clipboard

Metal shader debugging stopped working in XCode

Open kvark opened this issue 5 years ago • 2 comments

It used to be the case where we'd do a GPU capture of a gfx-rs workload on Metal, and be able to deubg through the shaders. Now it complains with: Screen Shot 2020-05-15 at 12 30 20

When building Metal examples, it's solved by enabling the source information here: Screen Shot 2020-05-15 at 12 29 35

I checked the metallib tool options, and one sounds relevant:

--extract-source Extract contents of the SOURCES section from a MetalLib file

We'd want to make it include the source information in debug builds for all user shaders.

kvark avatar May 15 '20 16:05 kvark

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

kvark avatar Aug 03 '20 00:08 kvark

I looked more at this, and concluded that there is no official mechanism to achieve this when going through newLibraryWithSource. Filed FB8247902 to Apple (and added to our list of bugs)...

kvark avatar Aug 03 '20 00:08 kvark