[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-75823":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},75823,"slang","shader-slang\u002Fslang","shader-slang","Making it easier to work with shaders",null,"https:\u002F\u002Fgithub.com\u002Fshader-slang\u002Fslang","C++",5363,453,54,815,0,14,26,72,42,38.97,false,"main",[25,26,27,28,29,30],"shaders","hlsl","glsl","d3d12","vulkan","cuda","2026-06-12 02:03:36","Slang\n=====\n![CI Status](https:\u002F\u002Fgithub.com\u002Fshader-slang\u002Fslang\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg?branch=master)\n![CTS Status](https:\u002F\u002Fgithub.com\u002Fshader-slang\u002Fslang\u002Factions\u002Fworkflows\u002Fvk-gl-cts-nightly.yml\u002Fbadge.svg)\n\nSlang is a shading language that makes it easier to build and maintain large shader codebases in a modular and extensible fashion, while also maintaining the highest possible performance on modern GPUs and graphics APIs.\nSlang is based on years of collaboration between researchers at NVIDIA, Carnegie Mellon University, Stanford, MIT, UCSD and the University of Washington.\n\n\nWhy Slang?\n---------------\n\nThe Slang shading language is designed to enable real-time graphics developers to work with large-scale, high-performance shader code.\n\n### Write Shaders Once, Run Anywhere\n\nThe Slang compiler can generate code for a wide variety of targets: D3D12, Vulkan, Metal, D3D11, CUDA, and even generate code to run on a CPU. For textual targets, such as Metal Shading Language (MSL) and CUDA, Slang produces readable code that preserves original identifier names, as well as the type and call structure, making it easier to debug.\n\n### Access the Latest GPU Features\n\nSlang code is highly portable, but can still leverage unique platform capabilities, including the latest features in Direct3D and Vulkan. For example, developers can make full use of [pointers](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fconvenience-features.html#pointers-limited) when generating SPIR-V.\nSlang's [capability system](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fcapabilities.html) helps applications manage feature set differences across target platforms by ensuring code only uses available features during the type-checking step, before generating final code. Additionally, Slang provides [flexible interop](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fa1-04-interop.html) features to enable directly embedding target code or SPIR-V into generated shaders.\n\n### Leverage Neural Graphics with Automatic Differentiation\n\nSlang can [automatically generate both forward and backward derivative propagation code](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fautodiff.html) for complex functions that involve arbitrary control flow and dynamic dispatch. This allows existing rendering codebases to easily become differentiable, or for Slang to serve as the kernel language in a PyTorch-driven machine learning framework via [`slangtorch`](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fa1-02-slangpy.html).\n\n### Scalable Software Development with Modules\n\nSlang provides a [module system](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fmodules.html) that enables logical organization of code for separate compilation. Slang modules can be independently compiled offline to a custom IR (with optional obfuscation) and then linked at runtime to generate code in formats such as DXIL or SPIR-V.\n\n### Code Specialization that Works with Modules\n\nSlang supports [generics and interfaces](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Finterfaces-generics.html) (a.k.a. type traits\u002Fprotocols), allowing for clear expression of shader specialization without the need for preprocessor techniques or string-pasting. Unlike C++ templates, Slang's generics are pre-checked 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, entirely under application control.\n\n### Easy On-ramp for HLSL and GLSL Codebases\n\nSlang's syntax is similar to HLSL, and most existing HLSL code can be compiled with the Slang compiler out-of-the-box, or with just minor modifications. This allows existing shader codebases to immediately benefit from Slang without requiring a complete rewrite or port.\n\nSlang provides a compatibility module that enables the use of most GLSL intrinsic functions and GLSL's parameter binding syntax.\n\n### Comprehensive Tooling Support\n\nSlang comes with full support of IntelliSense editing features in Visual Studio Code and Visual Studio through the Language Server Protocol.\nFull debugging capabilities are also available through RenderDoc and SPIR-V based tools.\n\nGetting Started\n---------------\n\nThe fastest way to get started using Slang in your own development is to use a pre-built binary package, available through GitHub [releases](https:\u002F\u002Fgithub.com\u002Fshader-slang\u002Fslang\u002Freleases).\nSlang binaries are also included in the [Vulkan SDK](https:\u002F\u002Fvulkan.lunarg.com\u002Fsdk\u002Fhome) since version 1.3.296.0.\n\nThere are packages built for x86_64 and aarch64 Windows, Linux and macOS.\nEach binary release includes the command-line `slangc` compiler, a shared library for the compiler, and the `slang.h` header.\n\nSee the user-guide for info on using the `slangc` command-line tool: [Slang Command Line Usage](\nhttps:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Fcompiling.html#command-line-compilation-with-slangc).\n\nIf you want to try out the Slang language without installing anything, a fast and simple way is to use the [Slang Playground](https:\u002F\u002Fshader-slang.com\u002Fslang-playground). The playground allows you to compile Slang code to a variety of targets, and even run some simple shaders directly within the browser. The playground loads Slang compiler to your browser and runs all compilation locally. No data will be sent to any servers.\n\nIf you would like to build Slang from source, please consult the [build instructions](docs\u002Fbuilding.md).\n\nDocumentation\n-------------\n\nThe Slang project provides a variety of different [documentation](docs\u002F), but most users would be well served starting with the [User's Guide](https:\u002F\u002Fshader-slang.github.io\u002Fslang\u002Fuser-guide\u002F).\n\nFor developers writing Slang code, the [Slang Core Module Reference](https:\u002F\u002Fshader-slang.com\u002Fstdlib-reference\u002F) provides detailed documentation on Slang's built-in types and functions.\n\nWe also provide a few [examples](examples\u002F) of how to integrate Slang into a rendering application.\n\nThese examples use a graphics layer that we include with Slang called \"GFX\" which is an abstraction library of various graphics APIs (D3D11, D2D12, OpenGL, Vulkan, CUDA, and the CPU) to support cross-platform applications using GPU graphics and compute capabilities. \nGFX is being deprecated in favor of [slang-rhi](https:\u002F\u002Fgithub.com\u002Fshader-slang\u002Fslang-rhi).\n\nAdditionally, we recommend checking out [Vulkan Mini Examples](https:\u002F\u002Fgithub.com\u002Fnvpro-samples\u002Fvk_mini_samples\u002F) for more examples of using Slang's language features available on Vulkan, such as pointers and the ray tracing intrinsics.\n\nContributing\n------------\n\nIf you'd like to contribute to the project, we are excited to have your input.\nThe following guidelines should be observed by contributors:\n\n* Please follow the contributor [Code of Conduct](CODE_OF_CONDUCT.md).\n* Bugs reports and feature requests should go through the GitHub issue tracker\n* Changes should ideally come in as small pull requests on top of `master`, coming from your own personal fork of the project\n* Large features that will involve multiple contributors or a long development time should be discussed in issues, and broken down into smaller pieces that can be implemented and checked in in stages\n\n[Contribution guide](CONTRIBUTING.md) describes the workflow for contributors at more detail.\n\nLimitations and Support\n-----------------------\n\n### Platform support\n\nThe Slang compiler and libraries can be built on the following platforms:\n\n|  Windows  |   Linux   |   MacOS   |  WebAssembly |\n|:---------:|:---------:|:---------:|:------------:|\n| supported | supported | supported | experimental |\n\nBoth `x86_64` and `aarch64` architectures are supported on Windows, Linux and MacOS platforms.\n\n### Target support\n\nSlang can compile shader code to the following targets:\n\n|    Target   |                                         Status                                        |                          Output Formats                          |\n|:-----------:|:-------------------------------------------------------------------------------------:|:----------------------------------------------------------------:|\n| Direct3D 11 |    [supported](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#direct3d-11)    |                               HLSL                               |\n| Direct3D 12 |    [supported](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#direct3d-12)    |                               HLSL                               |\n|    Vulkan   |       [supported](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#vulkan)      |                            SPIRV, GLSL                           |\n|    Metal    |     [experimental*](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#metal)     |                      Metal Shading Language                      |\n|    WebGPU   |                                     experimental**                                    |                               WGSL                               |\n|     CUDA    |   [supported](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#cuda-and-optix)  |                        C++ (compute only)                        |\n|    Optix    | [experimental](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#cuda-and-optix) |                             C++ (WIP)                            |\n|     CPU     |   [experimental](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html#cpu-compute)  | C++ (kernel), C++ (host), standalone executable, dynamic library |\n\n> *Slang currently supports generating vertex, fragment, compute, task and mesh\n> shaders for Metal.\n\n> **WGSL support is still work in-progress.\n\nFor greater detail, see the [Supported Compilation\nTargets](https:\u002F\u002Fshader-slang.com\u002Fslang\u002Fuser-guide\u002Ftargets.html) section of the\n[User Guide](https:\u002F\u002Fshader-slang.github.io\u002Fslang\u002Fuser-guide\u002F)\n\nThe Slang project has been used for production applications and large shader\ncodebases, but it is still under active development. Support is currently\nfocused on the platforms (Windows, Linux) and target APIs (Direct3D 12, Vulkan)\nwhere Slang is used most heavily. Users who are looking for support on other\nplatforms or APIs should coordinate with the development team via the issue\ntracker to make sure that their use cases can be supported.\n\nLicense\n-------\n\nThe Slang code itself is under the Apache 2.0 with LLVM Exception license (see [LICENSE](LICENSE)).\n\nBuilds of the core Slang tools depend on the following projects, either automatically or optionally, which may have their own licenses:\n\n* [`glslang`](https:\u002F\u002Fgithub.com\u002FKhronosGroup\u002Fglslang) (BSD)\n* [`lz4`](https:\u002F\u002Fgithub.com\u002Flz4\u002Flz4) (BSD)\n* [`miniz`](https:\u002F\u002Fgithub.com\u002Frichgel999\u002Fminiz) (MIT)\n* [`spirv-headers`](https:\u002F\u002Fgithub.com\u002FKhronosGroup\u002FSPIRV-Headers) (Modified MIT)\n* [`spirv-tools`](https:\u002F\u002Fgithub.com\u002FKhronosGroup\u002FSPIRV-Tools) (Apache 2.0)\n* [`ankerl::unordered_dense::{map, set}`](https:\u002F\u002Fgithub.com\u002Fmartinus\u002Funordered_dense) (MIT)\n\nSlang releases may include [LLVM](https:\u002F\u002Fgithub.com\u002Fllvm\u002Fllvm-project) under the license:\n\n* [`llvm`](https:\u002F\u002Fllvm.org\u002Fdocs\u002FDeveloperPolicy.html#new-llvm-project-license-framework) (Apache 2.0 License with LLVM exceptions)\n\nSome of the tests and example programs that build with Slang use the following projects, which may have their own licenses:\n\n* [`glm`](https:\u002F\u002Fgithub.com\u002Fg-truc\u002Fglm) (MIT)\n* `stb_image` and `stb_image_write` from the [`stb`](https:\u002F\u002Fgithub.com\u002Fnothings\u002Fstb) collection of single-file libraries (Public Domain)\n* [`tinyobjloader`](https:\u002F\u002Fgithub.com\u002Ftinyobjloader\u002Ftinyobjloader) (MIT)\n","Slang 是一种着色器语言，旨在简化大规模高性能着色器代码库的构建和维护。它支持模块化和可扩展性开发，同时确保在现代GPU和图形API上实现最佳性能。Slang 编译器能够为多种目标生成代码，包括D3D12、Vulkan、Metal等，并且可以生成易于调试的文本格式代码。此外，Slang 提供了自动微分功能，使得现有渲染代码库可以轻松地变得可微分，适用于神经图形应用。其模块系统支持逻辑化的代码组织与独立编译，便于大型项目的管理和优化。Slang 适合需要跨平台兼容性和高性能图形处理能力的实时图形开发者使用。",2,"2026-06-11 03:53:25","trending"]