* Automate generating of intrinsic code
This change removes generated code for HLSL and DXIL intrinsics and
sets up the build system so that it will generate the code and
automatically regenerate it on changes to any of the generation scripts
or input files.
* Covering the last few generated files
* Move namespace priting into hctgen
I somehow missed that the open namespace was in manual code and the
close was in the generated code...
* Fix pix passes generator
* Work around missing autocrlf on Windows checkout
*shakes fist* AppVeyor...
* Actually pass through --force-lf
* Enable building LLVM testing tools
This gets a bunch of the LLVM testing tools building, which allows us
to run the LIT tests (which have a lot of failures)
* Fixing broken Linux and Windows builds
* Removing a change that snuck in.
* Changes to get LLVM unit tests building
This change gets the LLVM unit tests building again and running through
LIT via the `check-llvm-unit` target.
This change does not have the tests passing! Subsequent changes will
get the unit tests passing. This change also disables some tests where
the LLVM code is no longer used and making those tests work will
require substantial effort.
* Changes to get Clang unit tests building
This change gets the Clang unit tests building again and running
through LIT via the `check-clang-unit` target.
This change does not have the tests passing! Subsequent changes will
get the unit tests passing. This change also disables some tests where
the Clang code is no longer used and making those tests work will
require substantial effort.
* A few extra Windows fixes
This adds some missing APIs to the Windows Filesystem code and adds an
option to hctbuild to enable building the LLVM & Clang unit tests.
* Disable libClangFormat tests
These tests are a bit gnarly to repair... unless we really start using
the format library we probably just want to disable these tests.
* Restore lit and googletest sources from LLVM 3.7.0
This commit just re-adds sources that were removed somewhere along the
way.
* Pull in googletest & googlemock from LLVM 4.0
Googlemock was introduced in LLVM 4.0, and is used by SPIR-V's tests.
This pulls in the LLVM 4.0 version of GoogleTest and GoogleMock to
replace the external submodules.
LLVM's version of GoolgeTest and GoogleMock have some minor extensions
to work better with LIT for error reporting and producing cleaner test
output.
* Remove external googletest
* Fix lit to handle comment in gtest names
This fix came into LLVM with the updated googletest in a977582dead2
* Ignore raw_fd_ostream errors when not closing
There's some odditites with the changes in the filesystem code that
cause this to error sometimes in unit tests. Until we can dedicate time
to looking into the filesystem code, just swallow that error...
* Fix bot failure
Missed an option change.
* Fixing MSVC build failure
* A cleaner build fix
This should address issues with VS 2019 in a cleaner way.
* Fix build
Add new options to hctbuild that enable passing in additional arguments to cmake invocation
and also cmake customization hooks that will be included at the beginning and end of DXC's CMakeLists.txt.
Rework library search in FindD3D12.cmake and add one more library to look for.
Fix case in FindDiaSDK.cmake - fixes a cmake warning.
The original generation of HLSL macros containing version information
used the same generated header file as the RC file. This was fine except
when building in xbtools where the version information in the RC is
overridden to match the GDK.
To maintain the DXC macros as communicating the version of the DXC
component to better enable workarounds based on that information, the
same generator script is used, but the header file is separate and
doesn't abide by the fixed version location provided via cmake defines.
This way it will always contain DXC information while the RC file can
continue to contain the version information as it did before.
To allow for the case where the headers are not the same, a preliminary
version.gen file is created according to the dxc version requirements
and copied to the dxc header. In most cases, it is copied to the RC
header as well. When an explicit path is specified for the fixed
version, the DXC version uses the "offficial" generated header and the
RC file gets the version specified by the file in the given location.
Reverts the changes to the target_version_vertex.hlsl test since it
should always succeed now.
* Add HLSL macros with version information
Adds three sets of version information as defined macros available
to the shader.
The DXC version is included as __DXC_VERSION_{MAJOR|MINOR|RELEASE|COMMITS}
The values of these are set at compile time and derived from version.inc
RELEASE and COMMITS information varies according to the criteria
described in gen_version.py.
The HLSL Version is included as __HLSL_VERSION. It may be taken from
the -HV argument with which dxc was invoked, derived from other
arguments, or the default.
The shader target stage and version information is taken from the
-T argument with which dxc was invoked. For the stage, defined
constants representing each stage are defined at compile time that
correspond to the enum values used internally. The shader stage
specified by -T is determined at runtime and set to the corresponding
enum value. The major and minor versions are similarly derived from
the -T argument at runtime.
The runtime defines are set in InitializeStandardPredefinedMacros()
This allows them to be set just once and the same way for any way
that dxc is invoked including testing.
This makes some changes to how the version.inc file is generated and
found in cmake files in order to generate it regardless of the need
for a .rc resource file as it was before.
A series of hlsl tests are added that test for the defines presence
and values in order to add versus subtract with checks for the adds.
Since many of the defines are determined by arguments at runtime, a
few different tests were needed, but as much consolidation as possible
was done to reduce the number of individual test runs.
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.
This will give users a way to know the commit from which a DXC
library/binary was built from, so that they can compare different
libraries/binaries and report bugs easily.
dxc.exe now also prints the commit info using this new interface
method. It uses the following format:
(dev;<commit-count>-<commit-hash>)
This CL makes changes to CMake files in order to:
1- disable things that are not supported on non-Windows platforms.
2- make cross-platform compilation possible.
It also brings back LLVM's config.guess (mirrors:
https://github.com/llvm-mirror/llvm/blob/master/cmake/config.guess)
Suddenly the CompileWhenNoMemThenOOM test started to fail
on Appveyor even for a pull request that is trivial and does not
touch the source code. And we cannot reproduce this failure locally.
It's likely an Appveyor infrastructure issue; they updated a few things
yesterday.
I temporary disabled this test on Appveyor CI for now to unblock
other work. A following up PR to try to revert this PR and fix the issue.
- Fixed potential null pointer access
- make existence of external directory optional
- add DxilContainerAssembler change missing from ViewID Validation changes
- fix in ShaderOpTest.h for other build tools.
GoogleTest will be used for unit testing and codegen testing for
SPIR-V.
* Added SPIRV_BUILD_TESTS option in CMake to control building
of SPIR-V tests.
* Added "-spirvtest" into hctbuild to enable it.
* Added "spirv" and "spirv_only" targets for hcttest.
Running `hcttest spirv` will run ALL tests including SPIRV tests.
Running `hcttest spirv_only` will ONLY run SPIRV tests.
The default behavior of hctbuild and hcttest is not changed.
* [spirv] Add libclangSPIRV and skeleton FrontendAction for SPIR-V
* [spirv] Add -spirv into dxc for invoking EmitSPIRVAction
* [spirv] Build SPIR-V codegen conditionally
Added ENABLE_SPIRV_CODEGEN in CMake config to control the
building of SPIR-V component and wrap up SPIR-V code using it.
Also add -spirv to hctbuild to turn it on.
Fix#30: Revert license text in banner comments to original llvm verbage
This commit removes the Microsoft-specific copyright in llvm files
and reverts the copyright wording to the original llvm wording.
We used the following method to find the files to change:
1. Find all files in DirectXShaderCompiler that are also in llvm 3.7
2. For those files that have the Microsoft-specific copyright, revert
it to the original llvm copyright as present in llvm 3.7
3. Revert the copyright in a few files that are not in llvm, but are
mostly copies of files in llvm:
lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp
lib\Transforms\Scalar\Reg2MemHLSL.cpp
Leave the Microsoft-specific copyright header in files not present
in stock llvm:
include\dxc\*
lib\HLSL\*
lib\DxcSupport\*
tools\clang\test\HLSL\*
tools\clang\test\CodeGenHLSL\*
tools\clang\unittests\HLSL\*
tools\clang\unittests\HLSLHost\*
tools\clang\tools\dxcompiler\*
tools\clang\tools\dxa\*
tools\clang\tools\dxc\*
tools\clang\tools\dxopt\*
tools\clang\tools\dxr\*
tools\clang\tools\dxv\*
tools\clang\tools\dotnetc\*
utils\hct\*
CONTRIBUTING.md
COPYRIGHT
LICENSE-MIT
README.md
cmake\modules\FindD3D12.cmake
cmake\modules\FindDiaSDK.cmake
cmake\modules\FindTAEF.cmake
docs\DXIL.rst
docs\HLSLChanges.rst
docs\_themes\dxc-theme\layout.html
docs\_themes\dxc-theme\theme.conf
docs\_themes\dxc-theme\static\dxc-theme.css
include\llvm\llvm_assert\assert.h
include\llvm\llvm_assert\cassert
include\llvm\Support\MSFileSystem.h
include\llvm\Support\OacrIgnoreCond.h
lib\MSSupport\CMakeLists.txt
lib\MSSupport\MSFileSystemImpl.cpp
lib\Support\assert.cpp
lib\Support\MSFileSystemBasic.cpp
lib\Support\Windows\MSFileSystem.inc.cpp
lib\Transforms\Scalar\Reg2MemHLSL.cpp
lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp
tools\clang\docs\UsingDxc.rst
tools\clang\include\clang\AST\HlslTypes.h
tools\clang\include\clang\Basic\BuiltinsDXIL.def
tools\clang\include\clang\Basic\LangOptions.fixed.def
tools\clang\include\clang\Parse\ParseHLSL.h
tools\clang\include\clang\Sema\SemaHLSL.h
tools\clang\lib\AST\ASTContextHLSL.cpp
tools\clang\lib\AST\HlslTypes.cpp
tools\clang\lib\CodeGen\CGHLSLMS.cpp
tools\clang\lib\CodeGen\CGHLSLRuntime.cpp
tools\clang\lib\CodeGen\CGHLSLRuntime.h
tools\clang\lib\Frontend\Rewrite\FrontendActions_rewrite.cpp
tools\clang\lib\Parse\HLSLRootSignature.cpp
tools\clang\lib\Parse\HLSLRootSignature.h
tools\clang\lib\Parse\ParseHLSL.cpp
tools\clang\lib\Sema\gen_intrin_main_tables_15.h
tools\clang\lib\Sema\SemaHLSL.cpp
tools\clang\tools\d3dcomp\CMakeLists.txt
tools\clang\tools\d3dcomp\d3dcomp.cpp
tools\clang\tools\d3dcomp\d3dcomp.def
tools\clang\tools\libclang\dxcisenseimpl.cpp
tools\clang\tools\libclang\dxcisenseimpl.h
tools\clang\tools\libclang\dxcrewriteunused.cpp
tools\clang\tools\libclang\libclang.rc
tools\dxexp\CMakeLists.txt
tools\dxexp\dxexp.cpp
tools\dxexp\LLVMBuild.txt