Add METALLIB output support for the CLI#40
Conversation
|
This needs a rebase, I can test Linux builds this week with the right example input/output to compare with. |
|
If it helps wrap this up, let's skip Linux support for now. SDL_Process will let us do this eventually but it's not terribly important when you'll need a Mac to test Metal support anyway. |
madebr
left a comment
There was a problem hiding this comment.
This needs a rebase.
Let's just fail on non-supported platforms?
SDL3 also does not support gpu on all platforms.
| SDL_Process *process = SDL_CreateProcess(compileToIRCommand, true); | ||
| SDL_WaitProcess(process, true, &exitcode); |
There was a problem hiding this comment.
This has a chance to deadlock when metallib/xcrun echoes lots of data (when the pipe buffer is full, further writes will sleep).
Perhaps it's better to use SDL_CreateProcessWithProperties and set a null stdin/stdout/stderr?
Or, if that does not work, close stdin and read all stdout using SDL_ReadProcess
(Same applies to the next SDL_CreateProcess)
Resolves #39
In addition to the new
METALLIBoutput format, this also adds an optional--platformargument to specify whether you're targeting macOS or iOS. I'm not including Simulator support because the iOS simulator is actually below our min specs at this point. tvOS and iOS appear to share the same Metal bytecode format so I don't think we need a separate platform for tvOS.Note again that this is exclusively for CLI -- runtime compilation of MSL can be handled by the Metal API with no special handling.
Remaining to-do: