This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Перейти к файлу
Helena Kotas 5edbabb2b1
Generate new version for each DX Compiler build (#2200)
Added generating of new version for each DX Compiler build. 

There are 3 kinds of version:
1. **Official build**
Built by using `hctbuild -official`. The version is based on the current DXIL version, latest official release and a number of commits since then. The format is `dxil_major.dxil_minor.release_no.commit_count`. For example a current official version would be something like `1.5.1905.42`. The latest release information is read from `utils\version\latest-release.json`. The `1905` corresponds to `dxil-2019-05-16` release branch and `42` is the number of commits since that release branch was created. For master branch the `commit_count` will be incremented by 10000 to distinguish it from stabilized official release branch builds. So the current official version of master would be someting like `1.5.1905.10042`.

2. **Dev build**
Build by using `hctbuild` with no other version-related option. The format is `dxil_major.dxil_minor.0.commit_count` where commit_count is the number of total commits since the beginning of the project.

3. **Fixed version build**
Build by using `hctbuild -fv`. Enables overriding of the version information. The fixed version is read from `utils\version\version.inc`. Location of the version file can be overriden by `-fvloc` option on `hctbuild`.

In addition to the numbered version the product version string on the binaries will also include branch name and last commit sha - `"1.5.1905.10042 (master, 47e31c8a)"`. This product version string is included in `dxc -?` output.
2019-06-28 15:16:34 -07:00
.vs Fix building with VS 2017 integrated cmake (#279) 2017-05-09 14:01:22 -07:00
autoconf [linux-port] Update CMake files. prepare for Linux. (#1312) 2018-05-29 15:19:37 -04:00
cmake Generate new version for each DX Compiler build (#2200) 2019-06-28 15:16:34 -07:00
docs Fix typo in documentation (#2273) 2019-06-19 08:26:48 -07:00
examples Clean up mistakes made when fixing copyright banners. 2017-01-25 14:36:50 -08:00
external [spirv] Update SPIRV-Tools and SPIRV-Headers (#2287) 2019-06-21 11:44:19 -04:00
include Fix PDB generation to not require embedded hash inside DxilContainer (#2272) 2019-06-19 16:03:12 -07:00
lib Removed quotations from debug name (#2303) 2019-06-26 11:52:24 -07:00
projects Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
resources Generate new version for each DX Compiler build (#2200) 2019-06-28 15:16:34 -07:00
test Updated comment to fix typo (#1637) 2018-11-13 11:06:23 -08:00
tools Generate new version for each DX Compiler build (#2200) 2019-06-28 15:16:34 -07:00
unittests Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
utils Generate new version for each DX Compiler build (#2200) 2019-06-28 15:16:34 -07:00
.clang-format first commit 2016-12-28 11:52:27 -08:00
.clang-tidy first commit 2016-12-28 11:52:27 -08:00
.gitattributes Fix line endings and add .gitattributes for default eol normalization (#1597) 2018-10-15 12:55:26 -07:00
.gitignore [spirv] Use git submodules for SPIR-V dependency projects (#455) 2017-07-24 13:12:48 -07:00
.gitmodules [spirv] Use git submodules for SPIR-V dependency projects (#455) 2017-07-24 13:12:48 -07:00
.travis.yml [ci] Try to fix Travis osx bot (#1841) 2019-01-14 13:48:21 -05:00
CMakeLists.txt Generate new version for each DX Compiler build (#2200) 2019-06-28 15:16:34 -07:00
CMakeSettings.json Clean up crlf and mixed line ending issues. (#391) 2017-06-29 16:26:20 -07:00
CONTRIBUTING.md first commit 2016-12-28 11:52:27 -08:00
LICENSE.TXT Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
LLVMBuild.txt Revert license text in banner comments to original llvm verbage (#33) 2017-01-24 17:54:00 -08:00
README.md [linux-port] Enable Travis Linux and macOS bots. (#1407) 2018-07-09 11:30:27 -04:00
ThirdPartyNotices.txt Add heading text for ThirdPartyNotices.txt 2017-02-24 16:30:31 -08:00
appveyor.yml Force cmake to use python3 (#2187) 2019-05-15 09:56:11 -04:00

README.md

DirectX Shader Compiler

Build status Build Status

The DirectX Shader Compiler project includes a compiler and related tools used to compile High-Level Shader Language (HLSL) programs into DirectX Intermediate Language (DXIL) representation. Applications that make use of DirectX for graphics, games, and computation can use it to generate shader programs.

For more information, see the Wiki.

Features and Goals

The starting point of the project is a fork of the LLVM and Clang projects, modified to accept HLSL and emit a validated container that can be consumed by GPU drivers.

At the moment, the DirectX HLSL Compiler provides the following components:

  • dxc.exe, a command-line tool that can compile HLSL programs for shader model 6.0 or higher

  • dxcompiler.dll, a DLL providing a componentized compiler, assembler, disassembler, and validator

  • various other tools based on the above components

The Microsoft Windows SDK releases include a supported version of the compiler and validator.

The goal of the project is to allow the broader community of shader developers to contribute to the language and representation of shader programs, maintaining the principles of compatibility and supportability for the platform. It's currently in active development across two axes: language evolution (with no impact to DXIL representation), and surfacing hardware capabilities (with impact to DXIL, and thus requiring coordination with GPU implementations).

SPIR-V CodeGen

As an example of community contribution, this project can also target the SPIR-V intermediate representation. Please see the doc for how HLSL features are mapped to SPIR-V, and the wiki page for how to build, use, and contribute to the SPIR-V CodeGen.

Building Sources

Note: Instead of building manually, you can download the artifacts built by Appveyor for the latest master branch at here.

Note: If you intend to build from sources on Linux/macOS, follow these instructions.

Before you build, you will need to have some additional software installed. This is the most straightforward path - see Building Sources on the Wiki for more options, including Visual Studio 2015 and Ninja support.

  • Git.
  • Visual Studio 2017. Select the following workloads: Universal Windows Platform Development and Desktop Development with C++.
  • Python. Version 2.7.x is required, 3.x might work but it's not officially supported. You need not change your PATH variable during installation.

After cloning the project, you can set up a build environment shortcut by double-clicking the utils\hct\hctshortcut.js file. This will create a shortcut on your desktop with a default configuration.

Tests are built using the TAEF framework. Unless you have the Windows Driver Kit installed, you should run the script at 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.

To build, run this command on the HLSL Console.

hctbuild

You can also clean, build and run tests with this command.

hctcheckin

To see a list of additional commands available, run hcthelp

Running Tests

To run tests, open the HLSL Console and run this command after a successful build.

hcttest

Some tests will run shaders and verify their behavior. These tests also involve a driver that can run these execute these shaders. See the next section on how this should be currently set up.

Running Shaders

To run shaders compiled as DXIL, you will need support from the operating system as well as from the driver for your graphics adapter. Windows 10 Creators Update is the first version to support DXIL shaders. See the Wiki for information on using experimental support or the software adapter.

Hardware Support

Hardware GPU support for DXIL is provided by the following vendors:

NVIDIA

NVIDIA's r396 drivers (r397.64 and later) provide release mode support for DXIL 1.1 and Shader Model 6.1 on Win10 1709 and later, and experimental mode support for DXIL 1.2 and Shader Model 6.2 on Win10 1803 and later. These drivers also support DXR in experimental mode.

Drivers can be downloaded from geforce.com.

AMD

AMDs driver (Radeon Software Adrenalin Edition 18.4.1 or later) provides release mode support for DXIL 1.1 and Shader Model 6.1. Drivers can be downloaded from AMD's download site.

Intel

Intel's 15.60 drivers (15.60.0.4849 and later) support release mode for DXIL 1.0 and Shader Model 6.0 as well as release mode for DXIL 1.1 and Shader Model 6.1 (View Instancing support only).

Drivers can be downloaded from the following link Intel Graphics Drivers

Direct access to 15.60 driver (latest as of of this update) is provided below:

Installer

Release Notes related to DXIL

Making Changes

To make contributions, see the CONTRIBUTING.md file in this project.

Documentation

You can find documentation for this project in the docs directory. These contain the original LLVM documentation files, as well as two new files worth nothing:

License

DirectX Shader Compiler is distributed under the terms of the University of Illinois Open Source License.

See LICENSE.txt and ThirdPartyNotices.txt 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.