This adds an isolated component *IDxcDxrFallbackCompiler* that is used by the D3D12 Raytracing Fallback Compiler. The component is responsible for linking together DXR shaders into a state machine capable of emulating function invocations including recursion, patching HLSL intrinsics, export renaming, and emulating Shader Record support. This component is compiled to a DxrFallbackCompiler.dll that gets consumedd with D3D12 Raytracing Fallback Compiler apps.
For deeper implementation details, I will be fleshing out lib\DxrFallback\readme.md
Some leftover work still required:
1. Currently the Fallback Layer tests compile to an exe that must be manually run. This should be refactored to conform with existing DXIL unittests.
Add -exports export1[[,export2,...]=internal][;...] for lib target
- Remove IDxcLinker::LinkWithExports, use -exports option instead
- Added renaming/cloning support to linker
- Added validation and tests
- Fix AV in DxilPreparePasses when patch constant function is shared
ID3D12LibraryReflection:
- Fix shader input type for typed buffer and dimension for tbuffer
- Deterministic function order by name
* Adds support for pause/resume in pipeline.
* Adds 0.0 as the validator version to indicate no validation should occur.
* Moves module parsing from dxcompiler down to HLSL library.
* Adds support for optimizer to process a DXIL part.
* Adds a form with designer support for the interactive optimizer.
See the comment in DxilDebugInstrumentation.cpp for a summary of how this-all works. Basically: instrument all instructions to output "trace" info to a UAV so that a debugger can reconstruct the execution of the shader and offer a debugger-like experience.
The pass implements functionality for PIX for the "pixel cost", "depth complexity" and "overdraw" visualizers. You can probably infer what the pass does from the names "overdraw" and "depth complexity": For each pixel rendered it increments a corresponding counter in a UAV of a buffer that is the same size as the render target. The "pixel cost" pass does the same thing, only the increment is a weight value calculated from the total cost of the draw call, as derived from PIX's GPU-side profiling system.
This pass will be used in PIX for "Dr. PIX experiments", wherein a workload is re-rendered with MSAA turned off in order to get an approximate understanding of the performance impact of MSAA.
* Add remove-discards pass
* explicit lfs
* Change pass name, remove copy-pasted member enum, reduced include set
* CR feedback: better way to delete instructions, stale comment, end iterator could go stale, CHECK-NOT is a good idea.
1. Add Function props for entry.
2. Create DxilEntrySignature to group DxilSignature.
3. Move generation of loadinput/storeoutput into HLSignatureLower.
This commit adds a new pass that will transform all the storeOutput
instructions in the program. For each element in the output
signature we create an alloca to hold writes to the output.
We rewrite each storeOutput to store to the alloca'd location
instead. Then at each function return point we store to
each element in the output signature by reading the latest
value from the alloca'd location.
The above transformation provides the following properties
for outputs after it is run.
1. Remove all dynamic indexing on output writes
2. Remove multiple writes to same output location
3. Ensure all output locations in the signature are written
We can now expand the following intrinsics:
Acos
Asin
Atan
Hcos
Hsin
Htan
The expansion uses the same approximation algorithms used by the d3d compiler.
- Update PSV data for GS multi stream out and other improvements
- Add ViewIDPipelineValidation.inl
- Refactor DxilSigPoint to .inl for easy external use
- Add Barycentrics feature flag
- Add DxilSignatureAllocator for signature packing
- Fix signature validation. Add more validation.
- Fix and add validation tests.
- Fix codegen for inout params with SV like SV_Coverage
- fix m_SemanticStartIndex on DxilSignatureElement::Initialize
- fix DxilSignatureElement::GetColsAsMask for start col == 2
- Add diags for signature allocation failures
- Use Regex in ValidationTest
This commit adds initial support for extension intrinsics and defines, including:
-Support for recognizing hlsl extensions as new intrinsic functions.
-Support for requesting lowering of extensions.
-Support for preserving semantic defines.
-Support for validating semantic defines.
This commit adds support for hlsl extensions in the form of additional
intrisic functions and semantic defines.
We now allow a dxcompiler instance to register that it can handle
additional intrinsic functions beyond the standard hlsl intrinsics. These
new intrinsics are called extensions. For each extension, the compiler
supplies a lowering strategy that is used by the dxcompiler to translate
from the source level intrinsic to a high-level dxil intrinsic.
We initially support the two lowering strategies: replicate and pack.
The replicate strategy will scalarize the vector elements in the call
and replicate the function call once for each element in the vector.
The pack strategy changes the vector arguments into literal struct
arguments.
We also now include support for "semantic defines". A semantic define is
a source level define whose value is preserved in the final dxil as
metatdata. The source level define can come as either a #define in
the hlsl source or a /D define from the command line.
We provide a hook to validate that a semantic define has a legal value
(for example to ensure that the value is an integer). Validation failures
can produce warnings and errors that will be emitted through the standard
clang diagnostic mechanism.
This code was originally written by marcelolr and modified by dmpots to
support packed lowering of intriniscs and validation of semantic defines.