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