-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
shader-slang: init at 2025.2 #358202
shader-slang: init at 2025.2 #358202
Conversation
31fcc1b
to
da803ae
Compare
da803ae
to
505ebe5
Compare
505ebe5
to
0713e75
Compare
b6eb23d
to
c561923
Compare
c561923
to
2d17782
Compare
c87d6ec
to
cb29bd5
Compare
cb29bd5
to
1058d53
Compare
1058d53
to
03aa831
Compare
Yeah great work since I'm assuming pinging me means it works already. I'm not familiar enough with packaging to determine if the code fits the style but just skimming the CMakeLists.txt to see what other features we could get I have a few. Debug symbols: Slangs seems to enable debug symbols for release builds https://github.com/shader-slang/slang/blob/master/CMakeLists.txt#L192 but I don't see a debug output on this drv. If the cmake compilation makes a binary with a build-id and debug symbols on our end it should be as simple as enabling Debug symbols is the only one I believe could be helpful now but the other 2 may be nice in the future. |
Yup it's functional, tested on Darwin and Linux. I didn't know about the package request issue before today as it was opened after I created this PR, but now that it's ready I double checked so I could link to it. I can look into the debug symbols. As for nvidia, I'd leave it out initially and we can look into adding unfree features (which anything depending on CUDA would be) in another PR. |
03aa831
to
9fa7ef8
Compare
Debug output has been added and I removed the explicit dependecy on apple-sdk_11, as that is now the default for x86_64-darwin as well |
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.
Nice!
9fa7ef8
to
da9bcf1
Compare
da9bcf1
to
e9369be
Compare
e9369be
to
0740d4f
Compare
Bumped to 2025.2, tested on aarch64-darwin and x86_64-linux |
|
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.
LGTM !
Closes #359925
Slang is a cross-platform and cross-graphics-API shading language that compiles to SPIR-V, HLSL, Metal, WGSL, and other targets. This PR packages the Slang command line tools (the compiler and the language server) as well as its libraries.
Currently using Slang's own vendored version of glslang as it is not compatible with version 15 (which we have in nixpkgs) yet. Considered disabling glslang altogether after some discussion on Matrix, but that would mean not being able to compile shaders to SPIR-V, which heavily reduces the usefulness of Slang (although that still leaves Metal and WebGPU, for example).Patching in glslang 15 compatibility wasn't too hard after I knew where to look (see3-glslang-15.patch
).LLVM is disabled by default as all Slang features except JIT for "host-callable" work without it. If LLVM is enabled through
withLLVM = true;
, the2-shared-llvm.patch
ensures libllvm and libclang are dynamically linked (can be disabled usingwithSharedLLVM = false;
).Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.