Repository navigation
Added METAL platform, Metal Shader Converter output and Windows host support - #25
Conversation
42181e9 to
b96586d
Compare
|
Hey Selim. Is this PR ready for a review or are you still working on it? |
|
@dzhdanNV Hey! I think this one's ready. I want to merge this as part of the Metal 4 backend for NRI I'm working on. One question for this PR, Also for the rest of the Metal 4 work here are my forks, I haven't opened PRs yet but it would be great if you can take a look (or if an issue in NRI repo is better that would work for me too for discussion) |
\O/
It's a bit concerning, but not a blocker. Try to invent a way to avoid hardcoded stuff. Please, provide some details.
Let's get rid of hard coded stuff if we can first
I have been working on many things simultaneously. I can't jump in right now. But feel free to start with opening an NRI PR first. I have a swarm of AI buddies, who will be happy to review, suggest fixes or fix if necessary. |
|
I'll make the ShaderMake path generic and let you know. Thanks! Will open the PR on NRI too. |
|
@dzhdanNV pr ready to review now, removed the hardcoding, updated pr message |
'-p METAL' compiles Metal Shading Language sources into '.metallib' libraries using 'xcrun -sdk <sdk> metal' (macOS only). New options: '--metalSdk', '--metalStd' and '--metalMinOS'; they and the resolved Metal compiler are part of the build signature.
'-p METAL --metalFromDXIL' compiles HLSL with DXC (same options as DXIL),
converts it with 'metal-shaderconverter' and writes Metal converter bundles
('.metalbundle': metallib and reflection JSON, see 'ShaderBlob.h'), usable
without the converter at runtime (e.g. on iOS). New options:
'--metalShaderConverter' and '--metalShaderConverterOptions' (also per config
line), passed to the converter as is. The deployment OS and version come from
'--metalSdk' and '--metalMinOS'. The converter, its library, the options and
contents of files referenced by them are part of the build signature.
- the ExternalProject is always built, so source changes (e.g. after bumping a pinned revision) rebuild the tool
|
synced to upstream |
|
Read-only review of head
The current Build workflow run is |
|
Feel free to fix what you can. The rest I will handle myself. |
- Windows: "metal.exe" is also looked up in the per-target "Metal Developer Tools\macos\bin" or "ios\bin" (selected by "--metalSdk"), after "bin" and before PATH - METAL: only "<metal_*>" and "<simd/...>" includes are exempt from dependency tracking and only for native MSL, HLSL with "--metalFromDXIL" is tracked like DXIL - ParseMetalConverterBundle: the metallib must follow the header and the reflection must follow the metallib, without overlaps, the metallib must be non-empty - CI: added a macOS build with a METAL smoke test (macosx, iphoneos, iphonesimulator)
|
added macos ci, addressed other feedback too |
|
Thanks. That's a lot. Let's merge! |
|
Wow, thanks for auto-build on MacOS! |
fs::file_time_typerep.-p METALcompiles MSL into.metallib. New options:--metalSdk,--metalStd,--metalMinOS.-p METAL --metalFromDXILcompiles HLSL with DXC, converts it with Metal Shader Converter and writes a.metalbundle(metallib + reflection JSON, read withShaderMake::ParseMetalConverterBundle). Converter options go through--metalShaderConverterOptions.SHADERMAKE_TOOLExternalProject is always built (a no-op without changes), so pin bumps no longer leave a stale binary.