Feature Description
Description
Currently, ZenithCompiler.cs resides directly in the core project, and the core project has a dependency on slangc.net (the .NET binding for the Slang compiler). This means that any project using the Zenith.NET core runtime (e.g., a game's release build) must carry the compiler SDK dependency.
Proposed Improvement
I suggest extracting all shader compilation-related code (including ZenithCompiler.cs and associated compilation logic) from the core project and moving it into a new, separate project called Zenith.NET.Shader.
Benefits of This Change
- Clear Separation of Concerns: The core project would focus on shader loading, binding, and runtime execution (RHI), while the
Zenith.NET.Shader project would focus on offline shader compilation and validation.
- Reduced Runtime Dependencies: For final release builds of games or applications, there would be no need to distribute or load
slangc.net and its native libraries, significantly reducing runtime footprint and startup overhead.
- Optimized Workflow: This naturally supports the "offline compilation" best practice. Developers could use
Zenith.NET.Shader in their tooling layer (e.g., editor or build server) to pre-compile .slang or .hlsl source files into final bytecode or DXIL/SPIR-V. The game runtime would only need to load these pre-compiled artifacts, without carrying the compiler SDK, improving runtime stability and security.
- Build Flexibility: It would allow users of the core library to choose their preferred shader compilation toolchain, rather than being limited to the Slang compiler.
I hope you'll consider this suggestion. If needed, I'm also willing to assist with the initial refactoring work and submit a pull request (PR). Thank you for creating such an excellent library!
Use Case
Zenith.NET --> Zenith.NET(RHI)+Zenith.NET.Shader
Engine ->Zenith.NET(RHI)
Editor->Zenith.NET.Shader(tool)
Additional context
No response
Feature Description
Description
Currently,
ZenithCompiler.csresides directly in the core project, and the core project has a dependency onslangc.net(the .NET binding for the Slang compiler). This means that any project using the Zenith.NET core runtime (e.g., a game's release build) must carry the compiler SDK dependency.Proposed Improvement
I suggest extracting all shader compilation-related code (including
ZenithCompiler.csand associated compilation logic) from the core project and moving it into a new, separate project calledZenith.NET.Shader.Benefits of This Change
Zenith.NET.Shaderproject would focus on offline shader compilation and validation.slangc.netand its native libraries, significantly reducing runtime footprint and startup overhead.Zenith.NET.Shaderin their tooling layer (e.g., editor or build server) to pre-compile.slangor.hlslsource files into final bytecode or DXIL/SPIR-V. The game runtime would only need to load these pre-compiled artifacts, without carrying the compiler SDK, improving runtime stability and security.I hope you'll consider this suggestion. If needed, I'm also willing to assist with the initial refactoring work and submit a pull request (PR). Thank you for creating such an excellent library!
Use Case
Zenith.NET--> Zenith.NET(RHI)+Zenith.NET.ShaderEngine ->Zenith.NET(RHI)
Editor->Zenith.NET.Shader(tool)
Additional context
No response