* 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
This commit generally only adds those instructions that intersect with
OpenCL.DebugInfo.100, although it does also add generation of
new DebugFunctionDefinition to tie DebugFunction to function.
Co-authored-by: baldurk <baldurk@baldurk.org>
* [templates] Instantiate HLSL Annotations
When instantiating decls, the HLSL annotations should be carried over
for any NamedDecls that have them.
This change resolves#4003
* Add test case covering HLSL annotations
This just adds a test case that covers a wide swath of HLSL annotations
and verifies that they all instantiate correctly.
RsourceDescriptorHeap and SamplerDescriptorHeap were predefined in all
shader models, not just 6.6+. By checking the shader model version
before declaring them, we can limit this to relevant shader models.
Added tests for 6.6 and 6.5 behavior when these are redefined
* Enable building llvm-dis
llvm-dis is a lightweight tool for reading IR modules as bitcode and
dumping them as textual IR. It is useful for debugging and verification
of bitcode-related issues.
This patch just re-enables the llvm-dis build and updates the code to
build cleanly on *nix systems.
* Fix broken windows build
I need to cleanup the WinIncludes usage, but that can be a seprate PR.
The reflection calculation involves a multiply by two that was always
float, which caused an internal assert when the variable was not float.
Now the constant uses the type of the other operand
When resolving template argument types if the originating type is a
literal type (i.e. `literal float` or `literal int`), we should instead
substitute the appropriate 32-bit type.
This change is two pieces:
The first translates template arguments from `literal <x>` into the
appropriate 32-bit type after deduction but before generating the
instantiated decl for non-builtin templates.
The second part allows `literal <x>` template parameters to match
against the appropriate instantiated 32-bit types.
This resolves#3973.
* Revert "Fix crash in Sema::CheckDerivedToBaseConversion when Paths is
empty. (#3327)"
This reverts commit 2903170ac5, but keeps
the test case, as the test case is important.
* Generate FlatConversion for buffer member access
ConstantBuffers and TextureBuffers need to behave at the AST level as
if they implicitly convert to the underlying buffer data type.
We do this when generting the AST, but we don't have the proper
overrides in place in `Sema::PerformObjectMemberConversion`.
This is the root cause of issue #3327, so this change should be layered
on a revert of 2903170ac.
This also addresses #3972.
'beanz/beanz/constant-buffer-template-issue-3972'.
../tools/clang/test/HLSLFileCheck/hlsl/template/BufferInExpansion.hlsl
'beanz/beanz/constant-buffer-template-issue-3972'.
../tools/clang/test/HLSLFileCheck/hlsl/template/BufferInExpansion.hlsl
'beanz/beanz/constant-buffer-template-issue-3972'.
../tools/clang/test/HLSLFileCheck/hlsl/template/BufferInExpansion.hlsl
Several instances of handling token strings made the assumption that
the strings were null terminated though they were not necessarily.
By changing the processing to using the full StringRef, the length is
used and the potential for reading invalid characters is eliminated
64-bit linux has 8 byte longs where Windows always uses 4 bytes. As a
result, the strings that exceeded the maximum 32-bit representation on
such platforms were not failing for extreme space/register values as
expected
Clang has added new warnings for possible unintended string
concatenations. When concatonating strings in an array literal warpping
the concatenation in parentesis quiets the warning.
These changes are a result of prototype work in PIX to support shader debugging for DXR,, which was an exercise to figure out how to support libraries in general in PIX. These changes are the result. It's all about iterating over all the library functions, rather than "the" entry point function.
In addition, to have something concrete to submit to a driver, there's the addition of codegen for the shader debugging "prolog", which chooses at runtime whether or not to emit instrumentation data for a given shader invocation based on its (in this case) thread id. This last is not yet ready for production in PIX, in that it is necessary but not sufficient to enable DXR shader debugging.
Enables the associated feature flags when 2021 is selected. Also adds a
feature flag for bitfields.
Add to all feature tests a variant that uses -HV 2021
Made some small changes to a template test that relied on vector
operands with binary logical operators
[SPIRV] Add support of the GL_EXT_spirv_intrinsics
Related to the issue: https://github.com/microsoft/DirectXShaderCompiler/issues/3919
Add these attributes
vk::ext_capability
vk::ext_extension
vk::ext_instruction
vk::ext_reference
vk::ext_literal
Note this commit allows the redeclaration of a HLSL intrinsic function using a function declaration with `vk::ext_instruction`.
Co-authored-by: Jaebaek Seo <jaebaek@google.com>
- Fix Barycentric system value translation
- Increment Register for array elements
- Add signature dumping to D3DReflectionDumper, plus other minor fixes
- Dump PatchConstantParameters when mesh shader
The check for short curcuit intrinsics failed to account for
intrinsic tables other than the default. This ensures that assumption is
correct before performing the check
Added a few other checks for similar uses
* Use IDxcVersionInfo instead of IDxcVersionInfo2 when git commit info is not available.
* Always add null terminator byte count to 'VersionStringListSizeInBytes'.
When processing the DXC_OUT_EXTRA_OUTPUTS output from a compile there
is an attempt to skip non-blob outputs. The check is written incorrectly
because the call to `GetOutput` will fail (when it tries to QueryInterface
on the blob output).
The fix is to check the HRESULT returned from GetOutput and skip the output
if it failed.
Found when using the dxclib from an external project. I did not see an easy
way to add a test for this.
Fix an issue where specialization constants could be emitted multiple times
(e.g., once by themselves and once in composites).
Note that the const value of a special const specified in the HLSL code cannot
be reused because the value of the special const will be determined at the
runtime. However, the special const itself can be reused similar to variables.
Co-authored-by: Jaebaek Seo <jaebaek@google.com>
Allow calling DxcInitThreadMalloc again after calling DxcCleanupThreadMalloc
Without this change we cannot call a sequence of
DxcInitThreadMalloc()
DxcCleanupThreadMalloc()
...
DxcInitThreadMalloc() // <- This will trigger an assert
because we hit an assert that assumes the default malloc pointer is nullptr.
Since loading a big object takes the memory pressure, reduction of the
load size can have some performance benefit. In particular, it is
useful for mobile GPUs. `-fspv-reduce-load-size` removes
OpLoad/OpCompositeExtract of struct/array types by running spirv-opt
--reduce-load-size pass.
Fixes#3889
This PR enables `vk::combinedImageSampler` support.
How to use `vk::combinedImageSampler`:
1. Define `SamplerState` and `Texture2D` with the same descriptor set and binding numbers e.g.,
```
[[vk::combinedImageSampler]][[vk::binding(0, 1)]]
SamplerState sam0;
[[vk::combinedImageSampler]][[vk::binding(0, 1)]]
Texture2D<float4> tex0;
```
2. Use them e.g., `tex0.SampleLevel(sam0, float2(1, 2), 10, 2);`
3. Run the legalization after SPIR-V codegen.
Note that we can use the texture `tex0` with samplers other than `sam0`
but we cannot use `sam0` with textures other than `tex0`.
The special HLSL matrix codegen didn't handle the comma operator. Since
the operation is simple enough, skip special handling and fallback to
the default behavior
Fixed#3916