Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Natalie Chouinard c45db48d56
Add initial dxil2spv executable (#4199)
Parses files containing DXIL (IR or bitcode) to an LLVM module.
2022-01-26 14:55:19 -05:00
Chris B 6cf0a6f7df
Automate generating of intrinsic code (#4001)
* 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
2021-11-02 13:43:47 -05:00
Chris B 3d17803bad
Enable building LLVM testing tools (#4023)
* 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.
2021-10-21 11:31:31 -05:00
Chris B 0a0ed9f50b
Make it possible to enable building LLVM & Clang unit tests (#4020)
* 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.
2021-10-20 12:32:45 -05:00
Chris B 4ca3a04252
Restore LLVM Testing Infrastructure (#4012)
* 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
2021-10-19 15:24:11 -05:00
Helena Kotas e621158fbf
Disable regeneration target for official builds as they always run a full clean build. (#3725)
This should eliminate the race-condition issue with "Cannot restore timestamp".
2021-04-29 19:13:30 -07:00
Helena Kotas e09223cc49
Enable debugging from kernel mode (#3637) 2021-03-26 20:46:56 -07:00
Minmin Gong a5365731f0
Change HLSL_DISABLE_DEBUG_ITERATORS to more natural HLSL_ENABLE_DEBUG_ITERATORS and flip the default value (#2885) 2020-05-14 10:29:56 -05:00
Minmin Gong 318e625924
Add an option to turn on/off debug iterators (#2879)
Add option to turn on/off debug iterators for more performant or more helpful debug builds
2020-05-13 11:00:35 -07:00
Helena Kotas 3049f4541b
CMake customization and bug fixes (#2874)
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.
2020-05-11 12:23:20 -07:00
Helena Kotas b053bfbaae
Add option to hctbuild.cmd to skip building dxilconv.dll and related tools (#2739) 2020-03-03 17:25:12 -08:00
Greg Roth de35705c77
Separate generation of DXC macro version info (#2681)
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.
2020-02-14 17:26:49 -07:00
Greg Roth d9242790d4
Add HLSL macros with version information (#2665)
* 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.
2020-01-30 16:54:59 -07:00
Helena Kotas 91e57feaf0
Fix hctbuild -fv build break (#2662) 2020-01-24 12:31:01 -08:00
Minmin Gong 513276e846 Fix the HLSL_VERSION_LOCATION when build DXC in a parent project (#2480) 2019-09-23 09:47:38 -07:00
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
Jaebaek Seo dd183fec9f
Force cmake to use python3 (#2187)
Force cmake to use python3
2019-05-15 09:56:11 -04:00
Lei Zhang 3987db0fa8
[spirv] Do not build tests by default and hook up with ctest (#1394)
This way we can just run ctest to invoke the tests, instead of
remembering the binary and its parameters.
2018-06-29 12:46:07 -04:00
Lei Zhang 94ec193042
Add IDxcVersionInfo2 for querying Git commit info (#1304)
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>)
2018-06-20 11:35:48 -04:00
Ehsan 37c35f2f6e
[linux-port] Update CMake files. prepare for Linux. (#1312)
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)
2018-05-29 15:19:37 -04:00
Ehsan 090d3680f9
Fix cmake for non-appveyor buildbot environments. (#1297) 2018-05-18 10:50:33 -04:00
Lei Zhang 4260d00a17
[appveyor] Disable CompileWhenNoMemThenOOM (#1295)
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.
2018-05-17 16:34:28 -04:00
Tex Riddell edb9905e69 Merge integration fixes (#344)
- 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.
2017-06-08 18:26:21 -07:00
Lei Zhang 3c6537a7d5 [spirv] Add GoogleTest as an external dependency (#285)
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.
2017-05-22 12:02:23 -07:00
Lei Zhang 1e58245a73 [spirv] Add SPIRV-Headers and SPIRV-Tools as external dependencies (#280)
We need SPIRV-Headers for spirv.hpp11 and SPIRV-Tools for SPIR-V
diassembling.
2017-05-09 18:33:24 -07:00
Lei Zhang 2c7a3fc39d [spirv] Add bare bone code for SPIR-V codegen (#233)
* [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.
2017-05-05 19:39:59 -03:00
David Peixotto f805233b49 Revert license text in banner comments to original llvm verbage (#33)
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
2017-01-24 17:54:00 -08:00
Marcelo Lopez Ruiz 6ee4074a4b first commit 2016-12-28 11:52:27 -08:00