暫無描述

Tex Riddell bbe8831fe1 fix dot-cfg so it doesn't act like dot-cfg-only (#556) 8 年之前
.vs 4bca8da154 Fix building with VS 2017 integrated cmake (#279) 8 年之前
cmake 669635dec7 Fix dense map grow case with exceptions (#529) 8 年之前
docs a727fc8838 [spirv] Support PS SV_Depth{Greater|Less}Equal and SV_IsFrontFace (#563) 8 年之前
examples e077864885 Clean up mistakes made when fixing copyright banners. 8 年之前
external 265c8db219 [spirv] Use EXCLUDE_FROM_ALL to ignore unused external targets (#489) 8 年之前
include 8c4f2db67e Add -NoLineDirectives to ignore #line. (#550) 8 年之前
lib bbe8831fe1 fix dot-cfg so it doesn't act like dot-cfg-only (#556) 8 年之前
projects f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
resources 6ee4074a4b first commit 8 年之前
test f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
tools d4f8ffaab6 [spirv] Optimize IfStmt codegen for const-eval'able conditions (#567) 8 年之前
unittests f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
utils eb0894c913 Support static const field with initializer (#520) 8 年之前
.clang-format 6ee4074a4b first commit 8 年之前
.clang-tidy 6ee4074a4b first commit 8 年之前
.gitignore bd2371f900 [spirv] Use git submodules for SPIR-V dependency projects (#455) 8 年之前
.gitmodules bd2371f900 [spirv] Use git submodules for SPIR-V dependency projects (#455) 8 年之前
CMakeLists.txt edb9905e69 Merge integration fixes (#344) 8 年之前
CMakeSettings.json 7f65e0f0d6 Clean up crlf and mixed line ending issues. (#391) 8 年之前
CONTRIBUTING.md 6ee4074a4b first commit 8 年之前
LICENSE.TXT f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
LLVMBuild.txt f805233b49 Revert license text in banner comments to original llvm verbage (#33) 8 年之前
README.md 4f4315cb6e Trim build instructions and link to Wiki 8 年之前
ThirdPartyNotices.txt 9a74306436 Add heading text for ThirdPartyNotices.txt 8 年之前
appveyor.yml bd2371f900 [spirv] Use git submodules for SPIR-V dependency projects (#455) 8 年之前

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.

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

Building Sources

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.

If you use Ninja to build the project, please make sure to supply -ninja to hcttest for testing.

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.

Drivers indicate they can run DXIL by reporting support for Shader Model 6, possibly in experimental mode. To enable support in these cases, the Developer mode setting must be enabled.

Hardware Support

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

NVIDIA's new r381 drivers (r381.65 and later) provide experimental mode support for DXIL 1.0 and Shader Model 6.0. Here are the release notes, and a download link.

AMD's latest driver with support for DXIL 1.0 and Shader Model 6 in experimental mode is Radeon Software Crimson ReLive Edition 17.4.2.

Software Rendering

In the absence of hardware support, tests will run using the Windows Advanced Rasterization Platform (WARP) adapter. To get the correct version of WARP working, in addition to setting Developer mode, you should install the 'Graphics Tools' optional feature via the Settings app (click the 'Apps' icon, then the 'Manage optional features' link, then 'Add a feature', and select 'Graphics Tools' from the list).

For more information, see this Wiki page.

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:

  • HLSLChanges.rst: this is the starting point for how this fork diverges from the original llvm/clang sources
  • DXIL.rst: this file contains the specification for the DXIL format
  • tools/clang/docs/UsingDxc.rst: this file contains a user guide for dxc.exe

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.