Replace the memcpy check for PSV0 part.
Build DxilPipelineStateValidation object from data in PSV0 part. Then
compare the content with information from input DxilModule.
With this change, the order of signature elements and resources could be
different between the container and the DxilModule.
And the StringTable could be in different order as well.
Second step for #6817
Move DxilValidation out of HLSL.
Also move code to validate dxil container into
DxilContainerValidation.cpp from DxilValidation.cpp.
This is a preparatory step for #6817.
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Internal build that has DXC as a submodule and that is built with a
different VC toolset version started failing after the pragma got moved
up in commit 0b9acdb75. Adding a duplicate pragma back at the original
location makes both compiler versions happy.
This PR contains two changes:
1) Moves a pragma to disable a warning, which seems to be required by
the new compiler.
2) Adds a preprocessor define to workaround the crashes caused by the
runner image mismatching C++ runtime versions.
The second change we will want to revert once the runner images are
fixed. The issue tracking the runner images is:
https://github.com/actions/runner-images/issues/10004
Related #6668
This commit fixes the setlocale( ) logic to include the UTF-8 supported
string value for Mariner distros.
It also introduces a new RAII class `ScopedLocale' which ensure that the
locale setting is set/reset during string conversion operations.
Fixes: #6201
---------
Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
Co-authored-by: cooppunix <cooppunix&mariner.com>
1. printf format mismatch.
2. avoid cast from CComPtr<IncludeHandlerVFSOverlayForTest> to
CComPtr<IDxcIncludeHandler>.
3. fix signed unsigned mismatch.
4. fix order of fields in constructor.
5. add override for override methods.
6. port
01f4209631
7. add copy assignment operator to avoid
-Wdeprecated-copy-with-user-provided-copy
8. disable -Wignored-qualifiers for taef header WexTestClass.h.
9. remove unused fields.
10. add -clang-cl for hctbuild.
1. fix order of fields in constructor.
2. fix compare warning for type mismatch by cast to same type.
3. use {} instead of {0} when initialize to all zero.
4. add override for override methods.
This change applies clang-format to all of the sources added in DXC that
were not part of the original LLVM/Clang 3.7 release when DXC forked.
This provides consistent code formatting across the codebase.
Fixes#5591.
The way taef tests were gathered and executed previously flattened the
list of arguments to a string. This allowed the weird /select: flag to
work correctly, but if any of the arguments had spaces, they were
misinterpretted having lost the implicit quotes around each.
By removing the flattening, putting a space between the flag and the
argument for /select: and removing the explicit quotes around that
argument, the command executes properly whether there are spaces or not
Additionally added a way to detect when these commands failed since they
were silently failing and skipping a large swath of testing when spaces
were present.
Fixes#5719
Add -Wno-unused-parameter -Wno-unknown-pragams -Wno-switch which are
enabled for clang in linux build.
Fix
-Wimplicit-fallthrough
-Wconstant-logical-operand (Thanks patch from Chris)
-Wunused-function
-Wunused-variable
-Wtrigraphs
-Wnonportable-include-path
Still more warnings to be fixed.
We don't keep these annotations up to date or rely on them, so to
simplify our platform layering and ease code formatting this change
removes all the SAL annotations from internal APIs. This change also
replaces most `_Analysis_Assme_(...)` annotations with `assert(...)`.
One `_Analysis_Assume_` in ParseDecl.cpp needed to be updated because it
was incorrect. The code was `_Analysis_Assume_(assert(name.size() >
sizeof("space"));`. When converted to an `assert` it fired in our test
suite because the sizeof a string literal includes the null terminator,
but the size of a StringRef does not.
A few of the `_Analysis_Assume_` annotations were removed because they
didn't make sense (like the ones inside the `DXASSERT` implementation,
and a few others were removed to avoid introducing additional header or
linkage dependencies.
This change does not introduce any functional or behavioral changes.
This is for enable clang-cl build.
The change will fix build error when use clang_cl_x64_x64 with
CMakeSettings.
Still many warnings and other issue to fix.
One more batch of NFC changes to get DXC ready to clang-format. This
change disables clang-format of some include blocks and breaks other
include blocks into groups. With this change all of the sources in DXC
can be clang-formatted and will continue to build on all supported
platforms.
This change prepares DXC sources to be ready to clang-format. This
change adds annotations to skip formatting parts of the code that will
break if clang-format modifies them due to include ordering or generated
C++. It also adds missing include and forward declarations where
clang-formatting resulted in moving things around that caused code
breakages.
This is for enable clang-cl build on windows.
The gtest fix is merging from
f66ab00704
to work around 'operator <<' is ambiguous on DefaultPrintNonContainerTo.
Lit TAEF files fixes:
- Use filter parameter when enumerating tests. This enables listing of
just the tests that should run, and it also filtering by architecture.
This is crucial for isolating ARM64 and ARM64EC versions of tests that
are in the same test dll.
- Fix verbose parameter - it was not getting applied
- Enable verbose on all tests - the output is shown only when the test fails
Related to #5489.
Add macro DXC_DISABLE_ALLOCATOR_OVERRIDES which, if defined, will use
the default CRT allocator for new/delete and malloc/realloc/free.
We need this on Chrome for our GN build of DXC, because our component
builds use libc++as a shared library, and we end up with mismatched
new/delete calls between libc++ and these custom overrides.
---------
Co-authored-by: Chris Bieneman <cbieneman@microsoft.com>
This reverts commit 0a1f7a19f4.
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.
This change is causing rendering issues on PCs with AMD GPU and is blocking an upcoming Windows release.
The target branch of this revert is a release branch based on release-1.7.2212 at commit 83f8c6c5 and it will be used for the upcoming Windows release. The dxilconv change stays in main, at least for now.
(cherry picked from commit 03df61df18)
When present in the library search path, linux builds of
libdxcompiler.so and the dxc executable should load libdxil.so and use
it for validation and signing. However, the code to do that was still
searching for dxil.dll even on these platforms.
This change creates appropriate names for the dxcompiler and dxil
libraries for each platform and uses them where appropriate.
In addition, this changes some of the internal interfaces from wide
chars to simple chars as the wide interface wasn't useful here.
1. added dxc_batch as dependent for clang tests.
2. Not run exec test by default.
3. Strip directory which has dxil.dll from %PATH% for taef test which not need it.
4. Add select_filter and use @Name for TestName.
* Enable mix select filter by use shell=True when open subprocess.
5. Only run execution test when dxil.dll exist or experimental mode enabled.
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 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.