暫無描述

rgba16f [Amazon] 8c9f50806c Make the Spirv output add the invariant flag if the position was marked as precise (#2) 4 年之前
.github 8711ee6e44 Update build artifact permissions (#5387) 2 年之前
autoconf a0b6fc1028 Add RISC-V 64 bit (#4894) 2 年之前
azure-pipelines 22b392ab8f Remove DXC.Release pipeline (#5073) 2 年之前
cmake 92ee02e9bd [lit] Make lit the only test runner (#5402) 2 年之前
docs 38fcd6f741 [SPIRV] Add option to preserve interface variables (#5400) 2 年之前
examples e077864885 Clean up mistakes made when fixing copyright banners. 8 年之前
external c201a11d6e Update submodule hashes for SPIRV-Tools and SPIRV-Headers. (#5450) 2 年之前
gcp-pipelines 06a7197e23 Enable lit by default. (#5133) 2 年之前
include c2552dc3d6 Adding a driver bug fix 1 年之前
lib c2552dc3d6 Adding a driver bug fix 1 年之前
projects 44f8833938 Add macro to disable usage of allocator overrides (#5296) 2 年之前
resources 5edbabb2b1 Generate new version for each DX Compiler build (#2200) 6 年之前
test a6cf6d7c08 Adding test as a copy into currently supported testsuite (for PR #5209) (#5216) 2 年之前
tools 8c9f50806c Make the Spirv output add the invariant flag if the position was marked as precise (#2) 1 年之前
unittests 32379dd559 Add zip range adapter and other utility functions (#5425) 2 年之前
utils bf7fd1a536 Allow select() to work with samplers (#5508) (#5524) 2 年之前
.clang-format 6ee4074a4b first commit 8 年之前
.clang-tidy 6ee4074a4b first commit 8 年之前
.gitattributes 026c192ca0 Adding line ending settings to .gitattributes (#4026) 3 年之前
.gitignore 60b1f859ae Update build to Visual Studio 2022 (new default); remove VS 2017 support (#4726) 2 年之前
.gitmodules 14a55b7738 [linux] Enable Reflection on *nix platforms (#4810) 2 年之前
CMakeLists.txt 92ee02e9bd [lit] Make lit the only test runner (#5402) 2 年之前
CMakeSettings.json 06a7197e23 Enable lit by default. (#5133) 2 年之前
CONTRIBUTING.md 2bd4ee7ca4 Remove unused and failing script (#5220) 2 年之前
LICENSE.TXT 2b8ef5b57e Removed source from debug module. Support slim PDB. (#3348) 4 年之前
LLVMBuild.txt f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
README.md 3c06afb989 Update required CMake version to 3.17.2 (#5418) 2 年之前
SECURITY.md 5df23a7b0d Adding Microsoft SECURITY.MD (#4464) 3 年之前
ThirdPartyNotices.txt 9a74306436 Add heading text for ThirdPartyNotices.txt 8 年之前
appveyor.yml 92ee02e9bd [lit] Make lit the only test runner (#5402) 2 年之前
azure-pipelines.yml 92ee02e9bd [lit] Make lit the only test runner (#5402) 2 年之前

README.md

DirectX Shader Compiler

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.

Visit the DirectX Landing Page for more resources for DirectX developers.

Downloads

You can download the latest successful build's artifacts (built by Appveyor) for the main branch: | Downloads | | |-----------|--------| | Windows | | | Ubuntu | |

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

  • dxilconv.dll, a DLL providing a converter from DXBC (older shader bytecode format)

  • 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).

Pre-built Releases

Binary packages containing the output of this project are available from appveyor. Development kits containing only the dxc.exe driver app, the dxcompiler.dll, and the dxil.dll signing binary are available here, or in the releases tab.

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

Building DXC requires:

  • Git.
  • Python - version 3.x is required
  • CMake - version >= 3.17.2
    • The bundled version with Visual Studio works for Windows.
  • The C++ 14 compiler and runtime of your choosing.
    • DXC is known to compile with recent versions of GCC, Clang and MSVC.

Building on windows additionally requires:

A new experimental simplified build and test workflow is documented here.

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.

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. If your system doesn't have the requisite association for .js files, this may not work. If so, open a cmd window and invoke: wscript.exe utils\hct\hctshortcut.js.

Tests are built using the TAEF framework which is included in the Windows Driver Kit.

To build, run this command on the HLSL Console.

hctbuild

You can also run tests with this command.

hcttest

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 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

AMD’s 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 [email protected] with any additional questions or comments.