Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/microsoft/shaderconductor
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
https://github.com/microsoft/shaderconductor
compiler d3d10 d3d11 d3d12 d3d9 dxil glsl graphics hlsl metal opengl opengl-es shader spir-v vulkan
Last synced: 4 days ago
JSON representation
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
- Host: GitHub
- URL: https://github.com/microsoft/shaderconductor
- Owner: microsoft
- License: mit
- Created: 2018-11-02T01:19:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-13T15:18:42.000Z (about 2 years ago)
- Last Synced: 2025-01-11T21:06:09.173Z (11 days ago)
- Topics: compiler, d3d10, d3d11, d3d12, d3d9, dxil, glsl, graphics, hlsl, metal, opengl, opengl-es, shader, spir-v, vulkan
- Language: C++
- Homepage:
- Size: 181 KB
- Stars: 1,788
- Watchers: 94
- Forks: 249
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# ShaderConductor
[![Build Status](https://dev.azure.com/msft-ShaderConductor/public/_apis/build/status/ShaderConductor-CI)](https://dev.azure.com/msft-ShaderConductor/public/_build/latest?definitionId=1)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages.
## Features
* Converts HLSL to readable, usable and efficient GLSL
* Converts HLSL to readable, usable and efficient ESSL
* Converts HLSL to readable, usable and efficient Metal Shading Language (MSL)
* Converts HLSL to readable, usable and efficient old shader model HLSL
* Supports all stages of shaders, vertex, pixel, hull, domain, geometry, and compute.Note that this project is still in an early stage, and it is under active development.
## Architecture
ShaderConductor is not a real compiler. Instead, it glues existing open source components to do the cross-compiling.
1. [DirectX Shader Compiler](https://github.com/Microsoft/DirectXShaderCompiler) to compile HLSL to [DXIL](https://github.com/Microsoft/DirectXShaderCompiler/blob/master/docs/DXIL.rst) or [SPIR-V](https://www.khronos.org/registry/spir-v/),
1. [SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross) to convert SPIR-V to target shading languages.![Architecture](Doc/Arch.svg)
## Prerequisites
* [Git](http://git-scm.com/downloads). Put git into the PATH is recommended.
* [Visual Studio 2017](https://www.visualstudio.com/downloads). Select the following workloads: Universal Windows Platform Development and Desktop Development with C++.
* [CMake](https://www.cmake.org/download/). Version 3.9 or up. It's highly recommended to choose "Add CMake to the system PATH for all users" during installation.
* [Python](https://www.python.org/downloads/). Version 2.7 or up. You need not change your PATH variable during installation.## Building
ShaderConductor has been tested on Windows, Linux, and macOS.
### The script way:
```
BuildAll.py
```
where,
* \ can be ninja or vs2017. Default is vs2017.
* \ can be vc141 on Windows, gcc or clang on Linux, clang on macOS.
* \ must be x64 (for now).
* \ can be Debug, Release, RelWithDebInfo, or MinSizeRel. Default is Release.
This script automatically grabs external dependencies to External folder, generates project file in Build/\-\-\-\[-\], and builds it.### The manual way:
```
mkdir Build
cd Build
cmake -G "Visual Studio 15" -T host=x64 -A x64 ../
cmake --build .
```After building, the output file ShaderConductor.dll can be located in \/Bin/\/. It depends on dxcompiler.dll in the same folder.
### Artifacts
You can download [the prebuilt binaries generated by CI system](https://dev.azure.com/msft-ShaderConductor/public/_build/latest?definitionId=1&view=results). Currently, artifacts for Windows, Linux, macOS are published every commit.
## License
ShaderConductor is distributed under the terms of MIT License. See [LICENSE](LICENSE) for details.
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.