floooh / sokol-tools

Command line tools for use with sokol headers
MIT License
229 stars 55 forks source link

Reminder: simplify metal bytecode compilation pipeline... #152

Open floooh opened 3 hours ago

floooh commented 3 hours ago

Apparently calling the separate metallib tool isn't needed anymore:

https://twitter.com/SebAaltonen/status/1844661256252194911

...but it would only make sense if we could get rid of the temporary .air and .dia files. Maybe calling metal with multiple input files works too?

floooh commented 3 hours ago

PS: also:

You still need to call metal twice. Once for compiling, once for .metallib linking. Just replace metallib command with metal command and it works. It's undocumented, but it works and avoids the recent bug in metallib command.

Now that you are calling metal twice, you need also -frecord-sources in your linker call. This wasn't needed with metallib.