When the specific target environment required is exactly
SPV_ENV_VULKAN_1_1_SPIRV_1_4, then make the error message explicitly
note that it is met by Vulkan 1.1 with Spirv 1.4 (rather than simply
requiring Vulkan 1.2).
Fixes#4313
* Add -arm64 to hcttest; exclude one more test with issues on ARM64 & WARP
* DXC arm64 fixes - testing before pushing to GitHub
* Exclude DenormTertiaryFloatOpTest
* ARM64EC fixes, no parallel for ARM64
* Disable crashing test; exclude only denorm preserve tests with issues
- 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)
Add SPIR-V validation after the module is generated, and apply some
fixes required for validation to succeed with a passthrough pixel
shader:
- Add execution mode
- Decorate with SPIR-V Locations
- Refactor some LowerTypeVisitor logic to a util function that is shared with
dxil2spv
- Remove extra pointerness on stage IO vars now that it is handled by
the above pass
{s|u}norm and {row|column}_major modifiers shouldn't have been added to
the block of basic types for parsing init-style cast expressions. When
hitting one of these cases, ParseCXXSimpleTypeSpecifier hits unreachable:
default:
llvm_unreachable("Not a simple-type-specifier token!");
Valid uses of these modifiers are parsed elsewhere. If we hit these
keywords here, they are not a valid expression, so goto tok_default_case
instead, which will produce normal errors instead of the internal error.
While we're at it, update VerifierHelper.py to fix issues, and update tests
to run clean with VerifierHelper.py all *.
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.
Add support for integer sampling as part of advanced texture ops in
Shader Model 6.7. This includes adding static border colors and allowing
integer resource types to be used by all Sample* operations through
Sema, Dxil generation, and validation when 6.7 is available.
Adds root signature compilation and filecheck testing.
Translate a DXIL entry function to a SPIR-V entry function. This is
currently only supporting the few types and instructions needed to
create the entry function for a simple passthrough pixel shader.
Read DXIL file directly into llvm::MemoryBuffer rather than through an
IDxcBlobEncoding. This also allows support for supplying file by STDIN
(not yet with dedicated CLI).
Also clean up some CMake LLVM dependencies.
* Make external sema source handle type completion
Prior to this change the HLSL built in types are inserted into the AST
during initialization as complete types missing their methods. The
method implementations are then inserted during parsing when handling
declarators and parameter declarations of the built in types.
This method of lazy expansion does not work with HLSL templates because
template declarators in dependent contexts are not handled by the
parser, so they bypass the code path that generates method definitions
(see #4315).
This change alters how we lazy initialize types. Instead of
lazy-initializing in parsing, this change lazy initializes when the
type is required to be complete. This is accomplished by creating the
built in type objects as incomplete decls, and adding an override for
`CompleteType` to the `HLSLExternalSource`.
This change simplifies our code because we can use the type's
`IsCompleteDefinition` flag to track types that have been completed
instead of our own bitmask system.
Fixes#4315
* Nest second isCompleteDefinition check
This will trigger in most but not all cases, so I can nest it under the
condition that triggers it to have a potentially different result.
* 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
Without this change, during DxilValueCache::ProcessAndSimplify_PHI,
MayBranchTo will return false for switch. If all but one case or default
block are collapsed into the switch's successor's phi (by simplifycfg), this
causes DxilValueCache to assume the remaining branch is the only predecessor
to the phi. If the corresponding incoming value is constant, DxilValueCache
will assume that's the only possible value, replacing the phi with the
constant.
With the change, MayBranchTo will return false only when a switch with a
constant condition would branch to a different successor.
The test was assigning a pixel shader that didn't exist due to the
conversion of mistaken code that was harmless in the previous form, but
results in an error message in the new.
A mipmapped texture containing the value of LOD at each location in each
level is used to sample at each level using SampleCmpLevel and confirm
that the correct level is used for the comparison.
Additionally, the result of SampleCmpLevelZero is compared to the
SampleCmpLevel equivalent
A texture containing an encoded value representing the X,Y location is
used to retrieve values at various samples using the 8 methods that
newly allow programmable values. Each result is compared to what is
expected based on the given coords and offsets.
Use environment variable HLSL_AGILITYSDK_DIR which you can point to
extracted contents of an AgilitySDK.
Automatically copy binaries to appropriate location when set.
Look for MinTe binary set from TAEF. If found, set a local TAEF binary
location.
If this is set when running execution tests, copy MinTe there, and if the
HLSL_AGILITYSDK_DIR was set, also copy agility SDK binaries under the
.\D3D12\ subdir there, so the test can automatically pick it up.
Add hctbins.cmd to copy extra bins necessary for running things out of
the ...\bin or ...\test directories such as HLSLHost.exe. This includes
AgilitySDK bins if set.
Update FindTAEF.cmake to set binary dir based on HLSL_TAEF_DIR
Since we don't actually support a single project building to multiple
architectures, we look for te.exe in x86 OR x64 subdir.
Whichever one is set in hctstart.cmd should be the one that will be used.
Default D3D12SDKPath to ".\D3D12"
Autodetect version when not specified or "/p:D3DSDKVersion=1"
If D3DSDKVersion specified, fail if it can't use Agility SDK.
Because the LPCSTR set to shader stages in ShaderOp are used as a key,
the string pointer has to match an entry. Normally this works because
all strings are added to a string map and the pointer from this is used
for all LPCSTR pointers.
ExecutionTest groups were trying to override the entries by searching each
entry point for the desired name, then setting the stage to the string
pointer of that entry, so the pointer would match.
Another way is to just use insert() on the string map, which is what all
the other code uses (during loading from XML, for instance).
This change adds ShaderOp::GetString() to make it convenient to get the
appropriate string pointer for whatever string you have, so you may simply
set this pointer to the shader stage, without iterating through all shaders,
looking for the matching name.
This adds a check to detect when an entry name is set for a stage, but that
entry name doesn't match any shader in the ShaderOp.
It also updates the code in ExecutionTest to use this pattern instead, so
future tests won't copy the old pattern.
One additional advantage to this pattern is error detection: if you used
the old pattern, you could end up not finding the entry, setting nullptr to
the stage, then what you run might be a different stage than you thought,
without any error or indication otherwise. Many tests expect the same
results written from different stages, so if the wrong stage produced the
results, the test would not detect this. Now you will get a failure during
execution in this case.
* Define tier 1.1 locally for builds against older SDK
* Disable warning about use of value cast to enum in case.
This is necessary because different SDK headers include or exclude this tier, and we want to match the value either way.
This never got enabled in dxcapi.cpp in spite of all the code to support
it being in place. This enables the creation of the interface and
enables the tests that were disabled for want of it.
As an incidental, correctly defines the REGDB_E_CLASSNOTREG which made
the lack of this interface on Linux hard to diagnose.
- Skip Sampler for gpuHandle
- Key m_DescriptorData map off descriptor name instead of resource name (potential many-to-one for descriptor to resource).
- Fix uninitialized structs used in SetupRenderTarget
- Fix explicit Viewport detection to use > 0 (since uninit might end up with some large negative number, preventing all PS invocations in a way that wouldn't trigger any debug layer spew - hard to track down). This check had caused a long-standing regression in HLSLHost.
- Fix Sampler enum naming convention to be consistent with other string names for XML.
- Fix issue preventing UINT32 values from being parsed from XML (making it more difficult to fill in texture data, like 8-bit unorm formats).
KW(CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED) was included when parsing keywords
starting with 'S' as well as 'C'. It should not have been included under
'S'. This change is minor cleanup, since it would never match that string
in this location. So this makes no behavioral change.
REGDB_E_CLASSNOTREG was defined to 1, which is a success code for HRESULT.
This value is returned when trying to create an unsupported object with DxcCreateInstance.
Since create appears to have succeeded, it would lead to a deref of a null pointer - segfault.
Uniquely detect low 16-bit usage properly for tbuffer, while detecting the case where full 32-bits are used that map to two 16-bit fields, requiring both fields to be marked.
Include handler is only meant to handle file requests. However, if DebugCompilationDir is not set, CGDebugInfo::getCurrentDirname() will try to get the current working directory, and on (*nix) it will expand $PWD, then perform status() on that. With a virtualized file system backed only by an include handler, you can't get thet status of files or directories, so failing the directory detection, it will attempt to open the file, which results in a call to get the file contents of the current working directory from the include handler.
The approach here is just to return DebugCompilationDir on HLSL, even if empty.
This prevents it from trying to fill it in automatically, cutting
off the path normally causing this problem.
A valid vertex shader output variable with SV_Position semantics may be
constructed from any HLSL BuiltinType that translates to a 32-bit
floating point type in the SPIR-V backend, so relax the requirements to
allow the use of additonal types (such as half4) when
-enable-16bit-types is false.
Fixes#4262
This change allows you to supply a root signature with a shader using the [RootSignature("...")] attribute, and will use that if no root signature was defined in the XML.
It will use the root signature from the first shader it encounters that has one.
* [SM6.7] QuadAny/All execution test (1/2)
This adds a first set of execution tests for QuadAny and QuadAll to test
compute, mesh, and amplification shaders. A separate execution test will
be coming for pixel shaders.
* Fixing QuadAny/All fallback expansion
The initial implementation missed one of the required bitwise
operations.
* Updating test case to reduce scope to compute only
This gets the test passing for SM 6.0 using the fallback implementation.
* Fixing mangled extra code