ShaderConductor
DirectXShaderCompiler
Our great sponsors
ShaderConductor | DirectXShaderCompiler | |
---|---|---|
2 | 33 | |
1,711 | 2,902 | |
1.5% | 2.0% | |
0.0 | 0.0 | |
over 1 year ago | 5 days ago | |
C++ | C++ | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ShaderConductor
-
Start project on Metal, port to DX11?
Have you seen this project: https://github.com/microsoft/ShaderConductor? It is maintained by Microsoft as well.
- I'm sick of shader caches. The way Steam Deck handles them needs to improve:
DirectXShaderCompiler
-
Building the DirectX shader compiler better than Microsoft?
Well... they are rewriting & upstreaming DXC to LLVM main (https://github.com/microsoft/DirectXShaderCompiler/wiki/Cont...) and want to kinda deprecate DCX. IIRC currently only compute shaders are supported but I may be very wrong.
> We may support DXBC generation in Clang in the future (we mentioned that in the original proposal to LLVM). That work is unlikely to begin for a few years as our focus will be on supporting DXIL and SPIR-V generation first.
I appreciate this quote[0] from the microsoft camp. Setting clear expectations that something will not be done is a nice bit of fresh air.
[0] https://github.com/microsoft/DirectXShaderCompiler/issues/57...
-
Vcc – The Vulkan Clang Compiler
Also Microsoft DirectX Shader Compiler[1] for HLSL. In fact, effort is ongoing to upstream HLSL support into Clang.[2][3][4]
To answer your other question—why LLVM instead of GCC:
- First-class support for non-Unix/Linux platforms. LLVM can be built on Windows and Visual Studio without ever needing a single GNU tool besides git[5]. Clang even has a MSVC-compatible interface that allows MSVC developers to switch to Clang without needing to change their command-line invocation[6].
- Written in C++ from the ground up, with a modular, first-class SSA IR-based interface.
- Permissive Apache 2.0 licence. As much as this might exasperate the open-source community, it allows for significantly faster iteration; things tend to be upstreamed when private/corporate developers realise it is hard to maintain separate forks.
All this allows LLVM to have a pretty mature infrastructure; some very large companies have contributed to its development.
[1]: https://github.com/microsoft/DirectXShaderCompiler
[2]: https://clang.llvm.org/docs/HLSL/HLSLDocs.html
[3]: https://github.com/microsoft/DirectXShaderCompiler/wiki/Cont...
[4]: https://discourse.llvm.org/t/rfc-adding-hlsl-and-directx-sup...
There's no need for transpilers these days, you can just compile HLSL to SPIR-V bytecode with dxc.
-
Shader Compilation
Use DXC and only HLSL for your main shader editing.
-
Proper way to access a read-only texture that has no sampler from an hlsl compute shader?
BTW, this problem can be reproduced as described below: - clone https://github.com/SaschaWillems/Vulkan.git - build the project and run it with arguments : -v - s hlsl to enable the validation layer and to use hlsl code - run ComputeShader project. The following validation error "Type mismatch on descriptor slot ..." will be shown in the console. - to fix it, as suggested above, you can replace the 3rd line of emboss.comp, sharpen.comp, and edgedetect.comp from: Texture2D inputImage : register(t0); //Creates validation errors to RWTexture2D inputImage : register(u0); //no validation errors (you'll then need to recompile the shaders to spv with a proper hlsl compiler such as Microsoft dxc)
-
Start project on Metal, port to DX11?
EDIT: There is also naga but it does not take HLSL as input: https://github.com/gfx-rs/naga but you can use DirectXShaderCompiler to compile to SpirV, then use naga to compile to Metal.
-
Is SPIRV-Cross a valid option to target Metal from HSSL?
I am starting work on a compute-driven rendering engine, and it seems that the best way to go around it will be to write code in HSSL, and then use DirectXShaderCompiler to generate SPIR-V, and SPIRV-Cross to then generate MSL. And while DXSC's repo has a page on incompatibilities, no such resource seems to exist for SPIRV-Cross targeting Metal.
-
Learning DirectX 12 in 2023
DirectX Shader Compiler
What are some alternatives?
shaderc - A collection of tools, libraries, and tests for Vulkan shader compilation.
glslang - Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
rust-gpu - 🐉 Making Rust a first-class language and ecosystem for GPU shaders 🚧
macOS_Wine_builds - Official Winehq macOS Packages
SPIRV-Cross - SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
slang - Making it easier to work with shaders
xshade - "cross shade" meta shading language and compiler
shaderc-rs - Rust bindings for the shaderc library.
DirectXTK - The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
NFSC_CustomVT - A decompiled and enhanced Visual Treatment and screen effects shader for NFS Carbon.
Vulkan - Examples and demos for the new Vulkan API
DirectXTK12 - The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++