ShadowDusk.Slang
0.21.0
dotnet add package ShadowDusk.Slang --version 0.21.0
NuGet\Install-Package ShadowDusk.Slang -Version 0.21.0
<PackageReference Include="ShadowDusk.Slang" Version="0.21.0" />
<PackageVersion Include="ShadowDusk.Slang" Version="0.21.0" />
<PackageReference Include="ShadowDusk.Slang" />
paket add ShadowDusk.Slang --version 0.21.0
#r "nuget: ShadowDusk.Slang, 0.21.0"
#:package ShadowDusk.Slang@0.21.0
#addin nuget:?package=ShadowDusk.Slang&version=0.21.0
#tool nuget:?package=ShadowDusk.Slang&version=0.21.0
ShadowDusk.Slang
Genuine Slang input for MonoGame/KNI: import, generics, interface conformances,
everything the real Slang compiler accepts. This
package bundles slangc and compiles .slang source with slangc -target hlsl, then hands
that HLSL to ShadowDusk's existing, unchanged, faithful DXC pipeline (the same DXC every .fx
uses).
using ShadowDusk.Core;
using ShadowDusk.Slang;
var result = await new SlangCompiler().CompileAsync(
slangSource, new CompilerOptions { Target = PlatformTarget.OpenGL, SourceFileName = "Blur.slang" });
byte[] mgfx = result.Value.Data;
The same route also feeds ShadowDusk's source-text converters, for SkiaSharp and raylib
(fragment-only, with the converters' own limits and SD06xx refusals):
var sksl = new SlangCompiler().ConvertToSksl(slangSource, new SkslConvertOptions { SourceName = "Fx.slang" });
var raylib = new SlangCompiler().ConvertToRaylib(slangSource, new RaylibConvertOptions { SourceName = "Fx.slang" });
Nothing to install: slangc rides inside this package for win-x64, linux-x64, osx-x64 and
osx-arm64 and resolves from your app's own output, whether you dotnet run or publish
self-contained. Two host floors come from the upstream binaries themselves:
- Linux needs a GCC 11+
libstdc++(Ubuntu 22.04 or later). - macOS needs macOS 26 or later: the upstream macOS build declares that minimum. ShadowDusk does not build its own slangc for older macOS; open an issue if you need one.
On any other host, SlangCompiler returns SD0620 naming the reason instead of crashing. That
includes Windows on Arm (win-arm64): upstream publishes a slangc for it, but it is not bundled, to
keep the package small for everyone else. Open an issue at
https://github.com/kaltinril/ShadowDusk/issues if you need it. (An x64 process on Windows on Arm
is a win-x64 host and works.)
Parameter names are the ones you wrote: cbuffer members, Texture2D/SamplerState globals,
and a combined Sampler2D Comb;, whose texture reflects as Comb
(effect.Parameters["Comb"].SetValue(texture)). A texture held in a struct global, in a
cbuffer/ParameterBlock, or taken as an entry-point uniform parameter has no name you
wrote that could identify it and is rejected with SD0640; declare it as a global of its own.
This is a separate, optional package. A consumer who does not add it pays zero size or
dependency cost. ShadowDusk.Compiler's own .slang support (an HLSL-compatible subset, no
extra package, every host including the browser) is untouched.
License note
The bundled slangc binaries are Apache-2.0 WITH LLVM-exception (see
THIRD-PARTY-NOTICES.txt in the package); ShadowDusk itself is MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ShadowDusk.Compiler (>= 0.21.0)
-
net8.0
- ShadowDusk.Compiler (>= 0.21.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.21.0 | 80 | 10/6/2026 |