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

37 Коммитов

Автор SHA1 Сообщение Дата
Xiang Li 9c3dab6896
Add lit test for execution test. (#4964)
* Add lit test for execution test.
* Treat taef skipped as lit Unsupported.
2023-01-27 01:34:56 +00:00
Chris B ac3a6ae9f4
Enable building with ninja through Visual Studio (#4889) 2023-01-05 23:07:36 -06:00
Greg Roth 7ad9c9c032
Fallthrough (#4843)
A common source of bugs. Although many of these were harmless, some were
not. By eliminating them and enabling this warning as an error, we won't
add more in the future.


Fixed a real SPIRV bug that required a test update to expect the correct behavior.
SPIRV testing was expecting incorrect results that came from a fallthrough error
2022-12-09 10:13:56 -08:00
harshpg 6eedcd2afa
Replacing fileIO exceptions with error codes (#4841)
Exceptions for error handling can have a significant performance impact. The exception-throw codepaths are usually cold, and rely on large in-memory tables that need to be paged in.

This change to instead propagate returned error codes simplifies the code and allows the compiler to more aggressively optimize around both success and failure conditions.
2022-12-05 16:24:30 -06:00
Chris B 7d9567cf80
Enable running tests under LIT (#4813)
* Enable running tests under LIT

If `CLANG_INCLUDE_TESTS=On`, the googletest unit tests are built as
part of the clang unit test suite. This allows them to run via lit
using the `check-clang-unit` target.

* Configure DXILConv tests to run under check-all
2022-11-29 18:59:16 -06:00
Ben Clayton 0a1f7a19f4
[DxbcConverter] Fix corruption of ICB integer values (#4790)
Use an array of 32-bit integer values instead of 32-bit float values for the `"dx.icb"` immediate constant buffer data.
This prevents the FPU flipping the 22nd bit of integer constants, when their bit pattern represents a float32 signalling NaN on x86 architecture.

Fixes #4786
2022-11-23 11:41:56 -05:00
Chris B 8ee6ed19f3
Cleanup Windows code to conform to stricter C++ 17 compiler (#4804)
* Cleanup windows build to conform to C++ 17

MSVC's C++ language implementation deviates from the standard in a
number of ways, this patch cleans up several issues that become errors
if you build DXC using clang-cl, which has a more strict
interpreteation of C++.

This change should not have any functional impact on the final program.

Specific changes include:
* static_assert(false...) is removed, this is always ill-formed by the
C++ standard.
* Under template instantiations implicit `this` is not always allowed.
* Character array `<` comparision is... probably not what was intended.
* Implicit conversions are stricter than MSVC enforces.
* Template base types need explicit type specialization when referred
to.
* It is illegal to initialize more than one member of a union.
* Scope nested enums cannot be forward declared.
* Header paths should be case-sensitive.
* Exception specifications of specific types are disallowed in C++ 17.
* Clang is stricter about const-correctness, especially as it relates
to constant c strings.

* Update based on review feedback.

* Converted string construction to copy-constructor calls.
* Removed constexpr method bodys to cause linker error.

* Catching other methods I missed.

* I was a bit too over-zealous deleting methods.
2022-11-22 15:31:36 -06:00
Xiang Li 24ca1f498e
Support taef run in lit. (#4762)
* Support taef run in lib.

lit.formats.taef is added to run taef under lit.

New lit target check-clang-hlsl is added to run clang-hlsl-test taef tests.

Add lit-target for dxil conv to set different hlsl data dir.
2022-11-14 10:33:16 -08:00
Helena Kotas 3ee5e140fc
Remove dxilconv tests dependency on FXC to enable testing on ARM64 (#4494) 2022-06-01 15:14:31 -07:00
Tex Riddell 07bf1ae857
Fix leak of FixedSizeMemoryStream object from DxilConv (#4483) 2022-05-27 18:56:48 -04:00
Tex Riddell 0c64351247
Fix leak of DxilContainerWriter in DxbcConverter (#4400) 2022-04-19 14:22:14 -07:00
Helena Kotas e38970626d
Remove test output files; update .gitignore (#4333)
- added *.dxo.converted to the list of extensions ignored by git
- renamed 3 test outputs from .fxc to .dxbc (which will make them to be ignored by git)
2022-03-17 13:55:33 -07:00
Tex Riddell e51701e707
DxilConv: Pad copied IO signature parts (#4330)
DXBC containers from some sources may have signature parts with unaligned sizes, such as from 9on12.

This change pads these signature parts when this is the case to avoid any
problems down the line.
2022-03-16 01:03:16 -04:00
Chris B fb873d0a14
Clean up debug preprocessor macros (#4305)
* Clean up debug preprocessor macros

This change removes the `DBG` macro value in favor of `NDEBUG`, and
also converts many uses of `_DEBUG` with `NDEBUG`.

_DEBUG is set by MSVC when debug information generation is enabled.
NDEBUG is set by CMake debug configurations and by LLVM on all
configurations when `LLVM_ENABLE_ASSERTIONS` is set.

Aligning with LLVM's NDEBUG usage allows a consistent pattern
throughout the codebase.

* Address PR feedback
2022-03-02 14:55:24 -06:00
Tex Riddell b338314f6e
Implement Shader Model 6.7 (#4260)
Shader Model 6.7 is still a work in progress.
Thanks to multiple contributors at Microsoft for this work.

Added support for additional advanced texture operations, including:
Raw Gather, Programmable Offsets, SampleCmpLevel, and RWTexture2DMSAA.

Added new QuadAny/QuadAll intrinsics to help with writing quad-uniform control flow.

Added [WaveOpsIncludeHelperLanes] pixel shader entry attribute, changing the
behavior of wave ops to treat helper lanes as active lanes.
2022-02-15 11:38:42 -08:00
Xiang Li 4452103355
Change getPassName return type to StringRef. (#4247) 2022-02-10 14:14:43 -08:00
Xiang Li 53ccb3adce
Support vs2022 build. (#4031)
* Support vs2022 build.
Still some issues like dndxc not work.
2021-10-26 08:38:29 -07:00
Helena Kotas 53b2ad9ffd
Add d3d12TokenizedProgramFormat.hpp header from the Windows Driver kit (#3617)
* Add d3d12TokenizedProgramFormat.hpp header from the Windows Driver kit.

The header is now open source under the University of Illinois Open Source License.
This change reduces the DX compiler projects dependencies on WDK to TAEF testing
framework only. That means the project can be built without WDK if tests are
excluded from the build (HLSL_INCLUDE_TESTS cmake option to OFF).

Fixes #2965
2021-03-25 12:19:38 -07:00
Tex Riddell 694e5657c3
DxilConv: Fix interface translation regression (uses space != 0) (#3437) 2021-02-08 19:01:06 -08:00
Tex Riddell 9dca645a99
DxilConv: localize caching of handles instead of storing in resource obj (#3376)
Future work would be confused by current meaning of Set/GetHandle
on DxilResourceBase, which didn't make sense anyway for this narrow
use case limited to DxilConv.

This change replaces that use with a local handle Value* cache keyed off
of the resource class and slot.
This is valid only for SM 5.0 and below, where the cache applies.
It can't be used generally for SM 5.1, which is an existing limitation,
so no change here.
2021-01-20 17:39:33 -08:00
Helena Kotas 2ac188b4ce
Minor refactoring to reduce size of dxilconv.dll (#3240)
Move llvm::findScalarElement and LoopSimplifyID into separate files
Remove unused code from DxbcConverter

Reduces dxilconv.dll size from 1,225kB to 1,019kB (-17%).
Measured on x86 release build with compiler optimization for size.
2020-11-05 15:39:09 -08:00
Minmin Gong c607bb3c03
Some improvements to cmake files of dxilconv (#2876)
1. Add unittests only when HLSL_INCLUDE_TESTS is on,
2. Rename dxilconv-tests.vcxproj.user.txt to .in, that's configure_file() normally takes,
3. Use target_include_directories instead of directory-based include_directories for simplicity
2020-10-22 09:55:04 -07:00
Helena Kotas 0d11f8f17b
Add missing DxcEtw dependency to dxilconv (#3194) 2020-10-12 18:24:18 -07:00
Tex Riddell bba76d6619
Fix vs2019 build warnings for custom build items (#3114)
This should fix the warnings that have this pattern:

warning MSB8065: Custom build for item "...\tmpdxcetw.h.rule" succeeded,
but specified output "...\include\dxc\tracing\dxc\tracing\tmpdxcetw.h"
has not been created. This may cause incremental build to work incorrectly.
2020-09-04 16:21:53 -07:00
Helena Kotas 13961cfe1f
Removing unnecessary DisableThreadLibraryCalls() calls (#3042) 2020-07-15 21:03:05 -07:00
Helena Kotas 73c0d97f0d
Enable arm build (#3030) 2020-07-08 15:10:02 -07:00
Tex Riddell b59671accf
Use HlslDataDir for DxilConv instead of DxilConvDataDir (#2961)
This was using a define before a header to change the option name.
An inline function used the define when adding the path to a filename.
Unfortunately, this header was included from multiple places with
different values defined for the variable name, and it seems that
sheer luck made it work for a while, even when called from a cpp
file that would have had it defined differently.
2020-06-09 20:19:38 -07:00
Helena Kotas 355c4fb6a3
Move Dxc runtime tracing one level up so other project can use it without referencing dxilconv (#2948) 2020-06-05 20:35:33 -07:00
Helena Kotas 1f767d7194
hcttest.cmd: Enable running standalone dxilconv tests (#2878)
Adds an option to hcttest to specify a custom set of binaries to copy to a test folder
plus a custom location of dxilconv.dll
2020-05-12 12:25:40 -07:00
Minmin Gong 7dc56492a0
Fix a couple warnings in code (#2746)
1. A warning about unused "group" variable
2. A CMake warning about unmatched if and endif
2020-04-20 00:54:34 -07:00
Adam Yang 43122fc20b
Special ICB variables for nops are now arrays for driver compat. (#2774) 2020-03-18 16:01:00 -07:00
Helena Kotas cf0560b493
DxilConv update - bug fixes and pre/post convert hooks (#2760)
* DxilConv update - bug fixes and pre/post convert hooks

* Fix tests
2020-03-10 16:55:54 -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
Helena Kotas 361f539c59
Fix x86-only build break and a few warnings (#2702) 2020-02-18 13:26:17 -08:00
Helena Kotas a42ffbf491
DXBC to DXIL Converter + unit tests (#2685)
Includes dxilconv-specific DXIL optimization passes added to opt.exe tool.
2020-02-11 12:07:26 -08: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