-
Notifications
You must be signed in to change notification settings - Fork 49
Add METALLIB output support for the CLI #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
METALLIB
output format, this also adds an optional--platform
argument 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: