As promised, here's the result of using spirv-cross to get the shader symbols.
A few caveats first, I can't get the original source shader to show up, it seems to be the intermediate result from the HLSL -> SPIR-V compilation. I'll bring this up with the DXC repository directly.
So tested toolchain is:
HLSL -> SPIRV -> AIR -> METALLIB, here's an example of a script to compile a pixel shader:
dxc -T ps_6_0 -E PSMain -spirv shaders/triangle.hlsl -Zi -Qembed_debug -O0 -Fo shaders/triangle.frag.spirv
spirv-cross --msl shaders/triangle.frag.spirv --output shaders/triangle.frag.metal
xcrun -sdk macosx metal -c -frecord-sources shaders/triangle.frag.metal -o shaders/triangle.frag.air
xcrun -sdk macosx metallib shaders/triangle.frag.air -o shaders/triangle.frag.metallib
As you can see, it's a lot more steps than metal shader converter, but after all those steps you can get some sort of shader symbols in xcode when debugging a metal frame, which is better than nothing:
Please let me know if I can provide files, projects or anything that can help supporting shader symbols directly with metal shader converter.
Cheers,
Alex
Topic:
Graphics & Games
SubTopic:
Metal
Tags: