Граф коммитов

31 Коммитов

Автор SHA1 Сообщение Дата
Christopher Wallis 74520bb662 Merged PR 98: Adding a DxrFallbackCompiler.dll containing IDxcDxrFallbackCompiler implementation + tests
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.
2018-06-29 23:43:40 +00:00
Tex Riddell 8db08cb21e Merged PR 74: Add -exports export1[[,export2,...]=internal][;...] for lib target
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
2018-05-23 06:48:01 +00:00
Young Kim 0777a7a020 Merge branch 'master' into rtmaster 2018-04-10 16:47:47 -07:00
Xiang Li 357803d342
Don't sink sample coordinate into control flow. (#1188) 2018-03-29 16:33:59 -07:00
Young Kim 20067a37fe Merged PR 35: Merge user/kiyoung/function-feature-flag to user/texr/rt-merge-rebase
- Refactoring ShaderFlag out of DxilModule
- Have Shader Flag per function on RDAT blob
2018-03-08 01:59:39 +00:00
Jeff Noyle ad3e51b1dd
New pass for PIX "shader access tracking" (#998)
* py changes

* checkpoint

* wrong overloads for a couple ops

* Correct out-of-range checking

* test

* RTV

* Add shader access tracking and reportage of dynamically indexed registers

* Uniquify and encode proper register index!

* remove unncessary noise

* rename a var
2018-01-19 14:47:06 -08:00
Xiang Li 0790e03364
Remove stacksave and stackstore. (#914) 2017-12-12 18:50:01 -08:00
Marcelo Lopez Ruiz 64f3b34995 Adds support for pipeline restart (#683)
* 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.
2017-10-11 14:04:24 -07:00
Jeff Noyle b06a8153ff Shader debug instrumentation (#680)
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.
2017-10-09 15:30:29 -07:00
Xiang Li e5c0e5ffaa Merge DivergenceAnalysis from llvm3.8. (#528) 2017-08-07 12:14:46 -07:00
Jeff Noyle d3f53b7f3e "Dr PIX": Force early Z (#467)
PIX has the ability to turn on early z and show you the performance difference with and without.
This pass implements the DXIL side of it.
2017-07-27 13:34:54 -07:00
Xiang Li 96c9c0597c Code cleanup. (#469)
1. Move DxilEmitMetadata out of DxilGenerationPass.cpp
2. Move helper function out of HLModule.
2017-07-26 11:02:20 -07:00
Jeff Noyle 47226d0422 PIX: Pixel count/cost pass (#457)
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.
2017-07-25 16:08:31 -07:00
Jeff Noyle 82fcc7ca0f (PIX) Reduce msaa to single-sample (#427)
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.
2017-07-14 13:40:49 -07:00
Jeff Noyle fa94808e09 Remove all discard instructions (#400)
* 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.
2017-06-30 13:57:12 -07:00
Jeff Noyle e0c24c6839 Implementation of "constant color output" pass for PIX (#371) 2017-06-27 10:11:24 -07:00
Xiang Li f408830296 Add linker. 2017-06-19 15:15:44 -07:00
Xiang Li 79bb311bd9 Code cleanup.
1. Add Function props for entry.
2. Create DxilEntrySignature to group DxilSignature.
3. Move generation of loadinput/storeoutput into HLSignatureLower.
2017-06-19 15:15:38 -07:00
David Peixotto 0ea6620342 Add pass to preserve all outputs (#326)
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
2017-05-30 09:41:54 -07:00
David Peixotto 489147d88c Add support for expanding trig intrinsics (#325)
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.
2017-05-23 08:15:59 -07:00
Tex Riddell 0b5ab5c87a Implement ViewIDPipelineValidation
- 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
2017-05-18 18:00:59 -07:00
Tex Riddell 8419a9abce Complete move to DxilSignatureAllocator.inl 2017-05-16 21:33:30 -07:00
Tex Riddell c2d2cef73f Merge pull request #295 from Microsoft/dxil-v1.1
Merge ViewID, PSV data, and validator updates
2017-05-16 13:38:41 -07:00
Xiang Li 8ce48081cf Add a pass to eliminate dynamic indexing on output. (#287)
1. Add a pass to eliminate dynamic indexing on output.
2. Fix issue in AllocateSemanticIndex where argIdx should only udpate for leaf node.
2017-05-12 11:10:58 -07:00
yurido1 df132d59b4 Initial implementation of ViewId state analysis. (#290) 2017-05-10 18:14:43 -07:00
Lei Zhang 892e7953fd Match filename cases (#199) 2017-04-10 22:52:10 -07:00
Xiang Li 73b6f95a40 Legalize sample offset when optimization is disabled. (#97) 2017-02-18 00:46:17 -08:00
Tex Riddell af6b2a552f fixes #37 - License cleanup. 2017-01-27 16:48:08 -08:00
Tex Riddell 55ba393c2c Signature packing, codegen fixes, and validation fixes and additions.
- 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
2017-01-17 18:10:16 -08:00
David Peixotto 9451f2c0b3 Add initial support for extension intrinsics and defines (#5)
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.
2017-01-17 17:51:13 -08:00
Marcelo Lopez Ruiz 6ee4074a4b first commit 2016-12-28 11:52:27 -08:00