ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages
Перейти к файлу
Minmin Gong bc374b16e4 [HLSL] Update SPIR-V to latest master to fix the error when converting a pixel shader to HLSL SM3.
Related work item: Github #6
2018-11-12 22:58:17 -08:00
.github/ISSUE_TEMPLATE Update issue templates 2018-11-09 23:11:56 -08:00
Doc Check in initial code 2018-11-07 23:29:45 -08:00
External [HLSL] Update SPIR-V to latest master to fix the error when converting a pixel shader to HLSL SM3. 2018-11-12 22:58:17 -08:00
Include/ShaderConductor Check in initial code 2018-11-07 23:29:45 -08:00
Source [HLSL] Update SPIR-V to latest master to fix the error when converting a pixel shader to HLSL SM3. 2018-11-12 22:58:17 -08:00
.appveyor.yml [CI] Add rules for AppVeyor 2018-11-09 20:42:56 -08:00
.clang-format Check in initial code 2018-11-07 23:29:45 -08:00
.gitattributes Check in initial code 2018-11-07 23:29:45 -08:00
.gitignore Check in initial code 2018-11-07 23:29:45 -08:00
BuildAll.py [CI] Add rules for AppVeyor 2018-11-09 20:42:56 -08:00
CMakeLists.txt Check in initial code 2018-11-07 23:29:45 -08:00
CONTRIBUTING.md Check in initial code 2018-11-07 23:29:45 -08:00
LICENSE Initial commit 2018-11-01 18:19:28 -07:00
README.md [Engineering] Update build script to add Ninja support. 2018-11-09 09:31:36 -08:00

README.md

ShaderConductor

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 to compile HLSL to DXIL or SPIR-V,
  2. SPIRV-Cross to convert SPIR-V to target shading languages.

Architecture

Prerequisites

  • Git.
  • Visual Studio 2017. Select the following workloads: Universal Windows Platform Development and Desktop Development with C++.
  • CMake. Version 3.9 or up. It's highly recommended to choose "Add CMake to the system PATH for all users" during installation.
  • Python. Version 2.7 or up. You need not change your PATH variable during installation.
  • (Optional) Windows Driver Kit. DirectXShaderCompiler's tests are built using the TAEF framework. Unless you have the Windows Driver Kit installed, you should run the script at External\DirectXShaderCompiler\utils\hct\hctgettaef.py from your build environment before you start building to download and unzip it as an external dependency. You should only need to do this once.

Building

ShaderConductor has been tested on Windows. Linux and macOS support are coming soon.

The script way:

  BuildAll.py <BuildSystem> <Architecture> <Configuration>

where,

  • <BuildSystem> can be ninja or vs2017. Default is vs2017.
  • <Architecture> can be x64 or x86. Default is x64.
  • <Configuration> 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 v141,host=x64 -A x64 ../
  cmake --build .

After building, the output file ShaderConductor.dll can be located in <YourCMakeTargetFolder>/Bin/<Configuration>/. It depends on dxcompiler.dll in the same folder.

License

ShaderConductor is distributed under the terms of MIT License. See LICENSE for details.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.