|
24 | 24 |
|
25 | 25 | The Slang system is designed to provide developers of real-time graphics applications with the services they need when working with large-scale and high-performance shader code. |
26 | 26 |
|
27 | | -* The Slang compiler can generate code for a wide variety of targets and APIs: D3D12, Vulkan, Metal, D3D11, OpenGL, CUDA, and CPU. Slang code can be broadly portable, but still take advantage of the unique features of each platform. For textual targets such as Metal Shading Language(MSL) and CUDA, Slang generates readable code that preserves the original identifier names and the type + call structure for ease of debugging. |
| 27 | +## Write Cross Platform Shaders |
| 28 | +<img class="fullwidthImage" style="max-width:600px" src="/assets/cross-platform.jpg"/> |
28 | 29 |
|
29 | | -* [Automatic differentiation](https://shader-slang.com/slang/user-guide/autodiff.html) as a first-class language feature. Slang can automatically generate both forward and backward derivative propagation code for complex functions that involve arbitrary control flow and dynamic dispatch. This allows users to easily make existing rendering codebases differentiable, or to use Slang as the kernel language in a PyTorch driven machine learning framework via [`slangtorch`](https://shader-slang.com/slang/user-guide/a1-02-slangpy.html). |
| 30 | +The Slang compiler can generate code for a wide variety of targets and APIs: D3D12, Vulkan, Metal, D3D11, OpenGL, CUDA, and CPU. Slang code can be broadly portable, but still take advantage of the unique features of each platform. For textual targets such as Metal Shading Language(MSL) and CUDA, Slang generates readable code that preserves the original identifier names and the type + call structure for ease of debugging. |
30 | 31 |
|
31 | | -* Generics and interfaces allow shader specialization to be expressed cleanly without resorting to preprocessor techniques or string-pasting. Unlike C++ templates, Slang's generics are checked ahead of time and don't produce cascading error messages that are difficult to diagnose. The same generic shader can be specialized for a variety of different types to produce specialized code ahead of time, or on the fly, completely under application control. |
| 32 | +## Access Latest GPU Feature |
| 33 | +<img class="fullwidthImage" style="max-width:800px" src="/assets/latest-feature.jpg"/> |
32 | 34 |
|
33 | | -* Slang provides a module system that can be used to logically organize code and benefit from separate compilation. Slang modules can be compiled offline to a custom IR (with optional obfuscation) and then linked at runtime to generate DXIL, SPIR-V etc. |
| 35 | +Being cross-platform does not need to mean reducing to accessible GPU feature set to the least common denominator of all platforms. |
| 36 | +Slang exposes latest features in Direct3D and Vulkan, and provides a capability system to allow application code to manage the feature set differences on different platforms. |
| 37 | +For example, Slang allows you to use [pointers](/slang/user-guide/convenience-features.html#pointers-limited) when generating SPIRV. |
| 38 | +In addition, Slang provides [flexible interop](/slang/user-guide/a1-04-interop.html) features to allow you to directly embed target code or SPIRV in your shaders. |
34 | 39 |
|
35 | | -* Parameter blocks (exposed as `ParameterBlock<T>`) provide a first-class language feature for grouping related shader parameters and specifying that they should be passed to the GPU as a coherent block. Parameter blocks make it easy for applications to use the most efficient parameter-binding model of each API, such as descriptor tables/sets in D3D12/Vulkan. |
| 40 | +## Automatic Differentiation |
| 41 | +<img class="fullwidthImage" style="max-width:800px" src="/assets/autodiff.jpg"/> |
36 | 42 |
|
37 | | -* Rather than require tedious explicit `register` and `layout` specifications on each shader parameter, Slang supports completely automate and deterministic assignment of binding locations to parameter. You can write simple and clean code and still get the deterministic layout your application wants. |
| 43 | +Slang can [automatically generate both forward and backward derivative propagation code](/slang/user-guide/autodiff.html) for complex functions that involve arbitrary control flow and dynamic dispatch. This allows users to easily make existing rendering codebases differentiable, or to use Slang as the kernel language in a PyTorch driven machine learning framework via [`slangtorch`](/slang/user-guide/a1-02-slangpy.html). |
38 | 44 |
|
39 | | -* For applications that want it, Slang provides full reflection information about the parameters of your shader code, with a consistent API across all target platforms and graphics APIs. Unlike some other compilers, Slang does not reorder or drop shader parameters based on how they are used, so you can always see the full picture. |
| 45 | +## Module System |
| 46 | +<img class="fullwidthImage" style="max-width:900px" src="/assets/modules-1.jpg"/> |
40 | 47 |
|
41 | | -* Slang is backwards-compatible with most existing HLSL code. It is possible to start taking advantage of Slang's benefits without rewriting or porting your shader codebase. |
| 48 | +Slang provides a [module system](/slang/user-guide/modules.html) that can be used to logically organize code and benefit from separate compilation. Slang modules can be compiled offline to a custom IR (with optional obfuscation) and then linked at runtime to generate DXIL, SPIR-V etc. |
42 | 49 |
|
43 | | -* Full intellisense features in Visual Studio Code and Visual Studio through the Language Server Protocol. |
| 50 | +## Code Specialization that Works with Modules |
44 | 51 |
|
45 | | -* Full debugging experience with SPIRV and RenderDoc. |
| 52 | +Slang supports [generics and interfaces](/slang/user-guide/interfaces-generics.html) (a.k.a. type traits/protocols) to allow clear expression of shader specialization without resorting to preprocessor techniques or string-pasting. Unlike C++ templates, Slang's generics are checked ahead of time and don't produce cascading error messages that are difficult to diagnose. The same generic shader can be specialized for a variety of different types to produce specialized code ahead of time, or on the fly, completely under application control. |
| 53 | + |
| 54 | +## Easy On-ramp from HLSL and GLSL |
| 55 | + |
| 56 | +Slang's syntax is similar to HLSL and most existing HLSL code can be compiled with the Slang compiler out-of-the-box, or with minor modifications. It is possible to start taking advantage of Slang's benefits without rewriting or porting your shader codebase. |
| 57 | + |
| 58 | +In addition, Slang offers a compatbility module that allows you to use most GLSL intrinsic functions and parameter binding syntax. |
| 59 | + |
| 60 | +## Comprehensive Tooling Support |
| 61 | +<img class="fullwidthImage" style="max-width:700px" src="/assets/tooling-support.jpg"/> |
| 62 | + |
| 63 | +Slang has full intellisense features in Visual Studio Code and Visual Studio through the Language Server Protocol. |
| 64 | +Full debugging experience is also available with SPIRV and RenderDoc. |
0 commit comments