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.
+The DXR Fallback Compiler is a specialized compiler that's a part of the [D3D12 Raytracing Fallback Layer](https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/Libraries/D3D12RaytracingFallback). The purpose of the DXR Fallback Compiler is to take input DXR shader libs and link them into a single compute shader that is runnable DX12 hardware (even without DXR driver support).
+
+## Building the DXR Fallback Compiler
+In order to build the DXR Fallback Compiler in Visual Studio, simply build the dxrfallbackcompiler project in the *Clang Libraries* folder.
+
+## Using with the D3D12 Raytracing Fallback Layer
+To use the DXR Fallback Compiler with the [DirectX Graphics Samples](https://github.com/Microsoft/DirectX-Graphics-Samples/blob/master/Samples/Desktop/D3D12Raytracing/readme.md), build a dxrfallbackcompiler.dll using the Build instructions and place the output dll in Samples/Desktop/D3D12Raytracing/tools/x64.
+
+If you're incorporating the Fallback Layer into your own personal project, you need to ensure that the dll is either alongside your executable or in the working directory.
+
+## Overview
+Note that the below overview and all proceeding documentation assumes familiarity with the DirectX Raytracing API.
+
+The DXR Fallback Compiler addresses several challenges that native DX12 compute shaders are not normally capable of handling:
+ * Combining multiple orthogonal shaders into a single large compute shader
+ * Uses of all new DXR HLSL intrinsics
+ * Invocation of another shader in the middle of shader code - *i.e. TraceRay and CallShader*
+ * Recursive invocations of shader calls
+
+These challenges are handled by abstractly viewing GPU execution of a DXR pipeline as State Machine traversal, where each shader is transformed into one or more state functions. further technical details are described in the header of [StateFunctionTransform.h](..\\DxrFallback\StateFunctionTransform.h).
+ // Unlike the LLVM version of this function, this does not requires the InstructionToReplace and the ValueToReplaceWith to be the same instruction type
+INITIALIZE_PASS(DxilPatchShaderRecordBindings, "hlsl-dxil-patch-shader-record-bindings", "Patch shader record bindings to instead pull from the fallback provided bindings", false, false)
+unsigned int DxilPatchShaderRecordBindings::AddSRVRawBuffer(Module &M, unsigned int registerIndex, unsigned int registerSpace, const std::string &bufferName) {
+unsigned int DxilPatchShaderRecordBindings::AddCBufferAliasedHandle(Module &M, unsigned int baseRegisterIndex, unsigned int registerSpace, const std::string &bufferName) {
+ const unsigned int maxConstantBufferSize = 4096 * 16;