master c59bfe7079bf cached
108 files
2.0 MB
541.7k tokens
1569 symbols
1 requests
Download .txt
Showing preview only (2,167K chars total). Download the full file or copy to clipboard to get everything.
Repository: microsoft/D3D12TranslationLayer
Branch: master
Commit: c59bfe7079bf
Files: 108
Total size: 2.0 MB

Directory structure:
gitextract_j6n7_r9v/

├── CMakeLists.txt
├── CONTRIBUTING.md
├── DxbcParser/
│   ├── CMakeLists.txt
│   ├── include/
│   │   ├── BlobContainer.h
│   │   ├── DXBCUtils.h
│   │   └── pch.h
│   └── src/
│       ├── BlobContainer.cpp
│       └── DXBCUtils.cpp
├── LICENSE
├── README.md
├── SECURITY.md
├── external/
│   ├── MicrosoftTelemetry.h
│   ├── d3d12compatibility.h
│   └── d3dx12.h
├── include/
│   ├── Allocator.h
│   ├── BatchedContext.hpp
│   ├── BatchedQuery.hpp
│   ├── BatchedResource.hpp
│   ├── BlitHelper.hpp
│   ├── BlitHelperShaders.h
│   ├── BlockAllocators.h
│   ├── BlockAllocators.inl
│   ├── CommandListManager.hpp
│   ├── D3D12TranslationLayerDependencyIncludes.h
│   ├── D3D12TranslationLayerIncludes.h
│   ├── DXGIColorSpaceHelper.h
│   ├── DeviceChild.hpp
│   ├── DxbcBuilder.hpp
│   ├── Fence.hpp
│   ├── FormatDesc.hpp
│   ├── ImmediateContext.hpp
│   ├── ImmediateContext.inl
│   ├── MaxFrameLatencyHelper.hpp
│   ├── PipelineState.hpp
│   ├── PrecompiledShaders.h
│   ├── Query.hpp
│   ├── Residency.h
│   ├── Resource.hpp
│   ├── ResourceBinding.hpp
│   ├── ResourceCache.hpp
│   ├── ResourceState.hpp
│   ├── RootSignature.hpp
│   ├── Sampler.hpp
│   ├── Sampler.inl
│   ├── Shader.hpp
│   ├── Shader.inl
│   ├── ShaderBinary.h
│   ├── SharedResourceHelpers.hpp
│   ├── SubresourceHelpers.hpp
│   ├── SwapChainHelper.hpp
│   ├── SwapChainManager.hpp
│   ├── ThreadPool.hpp
│   ├── Util.hpp
│   ├── VideoDecode.hpp
│   ├── VideoDecodeStatistics.hpp
│   ├── VideoDevice.hpp
│   ├── VideoProcess.hpp
│   ├── VideoProcessEnum.hpp
│   ├── VideoProcessShaders.h
│   ├── VideoReferenceDataManager.hpp
│   ├── VideoViewHelper.hpp
│   ├── View.hpp
│   ├── View.inl
│   ├── XPlatHelpers.h
│   ├── commandlistmanager.inl
│   ├── pch.h
│   └── segmented_stack.h
├── packages.config
├── scripts/
│   ├── BlitHelperShaders.hlsl
│   ├── CompileBlitHelperShaders.cmd
│   ├── CompileVideoProcessShaders.cmd
│   └── DeinterlaceShader.hlsl
└── src/
    ├── Allocator.cpp
    ├── BatchedContext.cpp
    ├── BlitHelper.cpp
    ├── CMakeLists.txt
    ├── ColorConvertHelper.cpp
    ├── CommandListManager.cpp
    ├── DeviceChild.cpp
    ├── DxbcBuilder.cpp
    ├── Fence.cpp
    ├── FormatDescImpl.cpp
    ├── ImmediateContext.cpp
    ├── Main.cpp
    ├── MaxFrameLatencyHelper.cpp
    ├── PipelineState.cpp
    ├── Query.cpp
    ├── Residency.cpp
    ├── Resource.cpp
    ├── ResourceBinding.cpp
    ├── ResourceCache.cpp
    ├── ResourceState.cpp
    ├── RootSignature.cpp
    ├── Shader.cpp
    ├── ShaderBinary.cpp
    ├── ShaderParser.cpp
    ├── SharedResourceHelpers.cpp
    ├── SubresourceHelpers.cpp
    ├── SwapChainHelper.cpp
    ├── SwapChainManager.cpp
    ├── Util.cpp
    ├── VideoDecode.cpp
    ├── VideoDecodeStatistics.cpp
    ├── VideoDevice.cpp
    ├── VideoProcess.cpp
    ├── VideoProcessEnum.cpp
    ├── VideoReferenceDataManager.cpp
    └── View.cpp

================================================
FILE CONTENTS
================================================

================================================
FILE: CMakeLists.txt
================================================
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.14)
project(d3d12translationlayer)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(FetchContent)
FetchContent_Declare(
    DirectX-Headers
    GIT_REPOSITORY https://github.com/Microsoft/DirectX-Headers.git
    GIT_TAG v1.619.1
)
FetchContent_MakeAvailable(DirectX-Headers)

option(USE_PIX "Enable the use of PIX markers" ON)

add_subdirectory(src)

if (HAS_WDK)
    add_subdirectory(DxbcParser)
    target_link_libraries(d3d12translationlayer dxbcparser)
endif()


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

This project welcomes contributions and suggestions. Most contributions require you to
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
and actually do, grant us the rights to use your contribution. For details, visit
https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

Note that this project is used within Microsoft for projects and components which are not open source. As such, changes which would impact those projects, such as changes to function signatures which are leveraged directly, will be subject to additional scrutiny. We welcome bugfixes and additional features which will improve the quality of Microsoft products, as well as other community projects which leverage this one.

================================================
FILE: DxbcParser/CMakeLists.txt
================================================
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.13)
project(dxbcparser)

add_library(dxbcparser STATIC
    src/BlobContainer.cpp
    src/DXBCUtils.cpp
    include/BlobContainer.h
    include/DXBCUtils.h
    include/pch.h)

target_include_directories(dxbcparser
    PUBLIC include
    PUBLIC ../external)

================================================
FILE: DxbcParser/include/BlobContainer.h
================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once 
#include <stddef.h>

#define DXBC_MAJOR_VERSION 1
#define DXBC_MINOR_VERSION 0
#define DXBC_1_0_MAX_SIZE_IN_BYTES 0x02000000
#define DXBC_MAX_SIZE_IN_BYTES 0x80000000

#define DXBC_FOURCC(ch0, ch1, ch2, ch3)                              \
            ((UINT)(BYTE)(ch0) | ((UINT)(BYTE)(ch1) << 8) |   \
            ((UINT)(BYTE)(ch2) << 16) | ((UINT)(BYTE)(ch3) << 24 ))

const UINT  DXBC_FOURCC_NAME = DXBC_FOURCC('D','X','B','C');

typedef enum DXBCFourCC
{
    DXBC_GenericShader              = DXBC_FOURCC('S','H','D','R'),
    // same as SHDR, but this will fail on D3D10.x runtimes and not on D3D11+.
    DXBC_GenericShaderEx            = DXBC_FOURCC('S','H','E','X'),
    DXBC_InputSignature             = DXBC_FOURCC('I','S','G','N'),
    DXBC_InputSignature11_1         = DXBC_FOURCC('I','S','G','1'),
    DXBC_PatchConstantSignature     = DXBC_FOURCC('P','C','S','G'),
    DXBC_PatchConstantSignature11_1 = DXBC_FOURCC('P','S','G','1'),
    DXBC_OutputSignature            = DXBC_FOURCC('O','S','G','N'),
    DXBC_OutputSignature5           = DXBC_FOURCC('O','S','G','5'),
    DXBC_OutputSignature11_1        = DXBC_FOURCC('O','S','G','1'),
    DXBC_InterfaceData              = DXBC_FOURCC('I','F','C','E'),
    DXBC_ShaderFeatureInfo          = DXBC_FOURCC('S','F','I','0'),
} DXBCFourCC;
#undef DXBC_FOURCC

#define DXBC_HASH_SIZE 16
typedef struct DXBCHash
{
    unsigned char Digest[DXBC_HASH_SIZE];
} DXBCHash;

typedef struct DXBCVersion
{
    UINT16 Major;
    UINT16 Minor;
} DXBCVersion;

typedef struct DXBCHeader
{
    UINT        DXBCHeaderFourCC;
    DXBCHash    Hash;
    DXBCVersion Version;
    UINT32      ContainerSizeInBytes; // Count from start of this header, including all blobs
    UINT32      BlobCount;
    // Structure is followed by UINT32[BlobCount] (the blob index, storing offsets from start of container in bytes 
    //                                             to the start of each blob's header)
} DXBCHeader;

const UINT32 DXBCHashStartOffset = offsetof(struct DXBCHeader,Version); // hash the container from this offset to the end.
const UINT32 DXBCSizeOffset = offsetof(struct DXBCHeader,ContainerSizeInBytes); 

typedef struct DXBCBlobHeader
{
    DXBCFourCC  BlobFourCC;
    UINT32      BlobSize;    // Byte count for BlobData
    // Structure is followed by BYTE[BlobSize] (the blob's data)
} DXBCBlobHeader;

class CDXBCParser;

//=================================================================================================================================
// CDXBCParser
//
// Parse a DXBC (DX Blob Container) that you provide as input.
//
// Basic usage:
// (1) Call ReadDXBC() or ReadDXBCAssumingValidSize() (latter if you don't know the size, but trust the pointer)
// (2) Call various Get*() commands to retrieve information about the container such as 
//     how many blobs are in it, the hash of the container, the version #, and most importantly
//     retrieve all of the Blobs.  You can retrieve blobs by searching for the FourCC, or
//     enumerate through all of them.  Multiple blobs can even have the same FourCC, if you choose to 
//     create the DXBC that way, and this parser will let you discover all of them.
// (3) You can parse a new container by calling ReadDXBC() again, or just get rid of the class.
// 
// Read comments inline below for full detail.
//
// (kuttas) IMPORTANT: This class should be kept lightweight and destructor-free;
//      other systems assume that this class is relatively small in size (less than a couple of pointers)
//      and that it does not need cleaning up.  If this ceases to be the case, the FX10
//      system will need some minor modifications to cope with this.
//
class CDXBCParser
{
public:
    CDXBCParser();

    // Sets the container to be parsed, and does some
    // basic integrity checking, such as ensuring the version is:
    //     Major = DXBC_MAJOR_VERSION
    //     Minor = DXBC_MAJOR_VERSION
    // 
    // Returns S_OK, or E_FAIL
    //
    // Note, if you don't know ContainerSize and are willing to 
    // assume your pointer pContainer is valid, you can call
    // ReadDXBCAssumingValidSize
    HRESULT ReadDXBC(const void* pContainer, UINT32 ContainerSizeInBytes); 
                                    

    // Same as ReadDXBC(), except this assumes the size field stored inside 
    // pContainer is valid.
    HRESULT ReadDXBCAssumingValidSize(const void* pContainer);                              

    // returns NULL if no valid container is set
    const DXBCVersion* GetVersion(); 
    // returns NULL if no valid container is set
    const DXBCHash* GetHash();                    
    UINT32 GetBlobCount();
    const void* GetBlob(UINT32 BlobIndex);
    UINT32 GetBlobSize(UINT32 BlobIndex);
    UINT   GetBlobFourCC(UINT32 BlobIndex);
    // fixes up internal pointers given that the original bytecode has been moved by ByteOffset bytes
    HRESULT RelocateBytecode(UINT_PTR ByteOffset); 
#define DXBC_BLOB_NOT_FOUND -1
    // Note: search INCLUDES entry at startindex
    // returns blob index if found, otherwise returns DXBC_BLOB_NOT_FOUND
    UINT32 FindNextMatchingBlob( DXBCFourCC SearchFourCC, UINT32 SearchStartBlobIndex = 0 ); 
                                    
private:
    const DXBCHeader*    m_pHeader;
    const UINT32*        m_pIndex;
};


================================================
FILE: DxbcParser/include/DXBCUtils.h
================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once 
#include "BlobContainer.h"
#include "d3d12TokenizedProgramFormat.hpp"

class CSignatureParser;
class CSignatureParser5;

UINT32 DXBCGetSizeAssumingValidPointer(const void* pDXBC); 
HRESULT DXBCGetInputSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference = false ); 
HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference = false ); 
HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignatureParser5* pParserToUse, bool bForceStringReference = false ); 
HRESULT DXBCGetPatchConstantSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference = false ); 

//=================================================================================================================================
//
// Signature Parser (not an encoder though)
//
//---------------------------------------------------------------------------------------------------------------------------------

typedef struct D3D11_SIGNATURE_PARAMETER 
{
    UINT Stream;
    char* SemanticName;
    UINT  SemanticIndex;
    D3D10_SB_NAME  SystemValue; // Internally defined enumeration
    D3D10_SB_REGISTER_COMPONENT_TYPE  ComponentType;
    UINT  Register; 
    BYTE  Mask; // (D3D10_SB_OPERAND_4_COMPONENT_MASK >> 4), meaning 4 LSBs are xyzw respectively.

    // The following unioned fields, NeverWrites_Mask and AlwaysReads_Mask, are exclusively used for 
    // output signatures or input signatures, respectively.
    //
    // For an output signature, NeverWrites_Mask indicates that the shader the signature belongs to never 
    // writes to the masked components of the output register.  Meaningful bits are the ones set in Mask above.
    //
    // For an input signature, AlwaysReads_Mask indicates that the shader the signature belongs to always
    // reads the masked components of the input register.  Meaningful bits are the ones set in the Mask above.
    //
    // This allows many shaders to share similar signatures even though some of them may not happen to use
    // all of the inputs/outputs - something which may not be obvious when authored.  The NeverWrites_Mask
    // and AlwaysReads_Mask can be checked in a debug layer at runtime for the one interesting case: that a 
    // shader that always reads a value is fed by a shader that always writes it.  Cases where shaders may
    // read values or may not cannot be validated unfortunately.  
    //
    // In scenarios where a signature is being passed around standalone (so it isn't tied to input or output 
    // of a given shader), this union can be zeroed out in the absence of more information.  This effectively
    // forces off linkage validation errors with the signature, since if interpreted as a input or output signature
    // somehow, since the meaning on output would be "everything is always written" and on input it would be 
    // "nothing is always read".
    union 
    {
        BYTE NeverWrites_Mask;  // For an output signature, the shader the signature belongs to never 
                                // writes the masked components of the output register.
        BYTE AlwaysReads_Mask;  // For an input signature, the shader the signature belongs to always
                                // reads the masked components of the input register.
    };
    
    D3D_MIN_PRECISION MinPrecision;
} D3D11_SIGNATURE_PARAMETER;

class CSignatureParser
{
    friend class CSignatureParser5;
public:
    CSignatureParser() { Init(); }
    ~CSignatureParser() { Cleanup(); }
    HRESULT ReadSignature11_1( D3D11_SIGNATURE_PARAMETER* pParamList, UINT* pCharSums, UINT NumParameters ); // returns S_OK or E_FAIL
    HRESULT ReadSignature11_1( __in_bcount(BlobSize) const void* pSignature,
                           UINT BlobSize,
                           bool bForceStringReference = false
                           ); // returns S_OK or E_FAIL
    HRESULT ReadSignature4( __in_bcount(BlobSize) const void* pSignature,
                           UINT BlobSize,
                           bool bForceStringReference = false
                           ); // returns S_OK or E_FAIL
    HRESULT ReadSignature5( D3D11_SIGNATURE_PARAMETER* pParamList, UINT* pCharSums, UINT NumParameters ); // returns S_OK or E_FAIL
    UINT    GetParameters( D3D11_SIGNATURE_PARAMETER const** ppParameters ) const; 
                            // Returns element count and array of parameters.  Returned memory is 
                            // deleted when the class is destroyed or ReadSignature() is called again.

    UINT    GetNumParameters()  const {return m_cParameters;} 
    HRESULT FindParameter( LPCSTR SemanticName, UINT SemanticIndex,
                           D3D11_SIGNATURE_PARAMETER** pFoundParameter) const; 
                            // Returned memory is deleted when the class is destroyed or ReadSignature is called again.
                            // Returns S_OK if found, E_FAIL if not found, E_OUTOFMEMORY if out of memory

    HRESULT FindParameterRegister( LPCSTR SemanticName, UINT SemanticIndex, UINT* pFoundParameterRegister);
                            // Returns S_OK if found, E_FAIL if not found, E_OUTOFMEMORY if out of memory

    UINT    GetSemanticNameCharSum( UINT parameter ); // Get the character sum for the name of a parameter to speed comparisons.

    bool CanOutputTo( CSignatureParser* pTargetSignature );
                // (1) Target signature must be identical to beginning of source signature (source signature can have 
                //     more entries at the end)  
                // (2) CanOutputTo also accounts for if the target always reads some of the values but the source never
                //     writes them. This can arise when signatures are being reused with many shaders, but some don't
                //     use all the inputs/outputs (the signatures still remain intact).

    void ClearAlwaysReadsNeverWritesMask(); 
                // Clear out AlwaysReads_Mask / NeverWrites_Mask for all elements in the 
                // signature to force the signature not to cause linkage errors when
                // passing the signature around after extracting it from a shader.
private:
    void Init();
    void Cleanup();

    D3D11_SIGNATURE_PARAMETER*  m_pSignatureParameters;
    UINT*                       m_pSemanticNameCharSums;
    UINT                        m_cParameters;
    BOOL                        m_OwnParameters;
};

class CSignatureParser5
{
public:
    CSignatureParser5() { Init(); }
    ~CSignatureParser5() { Cleanup(); }
    HRESULT ReadSignature11_1( __in_bcount(BlobSize) const void* pSignature,
                           UINT BlobSize,
                           bool bForceStringReference = false
                           ); // returns S_OK or E_FAIL
    HRESULT ReadSignature5( __in_bcount(BlobSize) const void* pSignature,
                           UINT BlobSize,
                           bool bForceStringReference = false
                           ); // returns S_OK or E_FAIL
    HRESULT ReadSignature4( __in_bcount(BlobSize) const void* pSignature,
                           UINT BlobSize,
                           bool bForceStringReference = false
                           ); // returns S_OK or E_FAIL
    UINT NumStreams() { return m_NumSigs; }
    UINT GetTotalParameters()  const {return m_cParameters;} 
    const CSignatureParser* Signature( UINT stream ) const { return &m_Sig[stream]; }
    const CSignatureParser* RastSignature() const { return ( m_RasterizedStream < D3D11_SO_STREAM_COUNT ) ? &m_Sig[m_RasterizedStream] : NULL; }
    void SetRasterizedStream( UINT stream ) { m_RasterizedStream = stream; }
    UINT RasterizedStream() { return m_RasterizedStream; };


private:
    void Init();
    void Cleanup();

    D3D11_SIGNATURE_PARAMETER*  m_pSignatureParameters;
    UINT*                       m_pSemanticNameCharSums;
    UINT                        m_cParameters;
    CSignatureParser            m_Sig[D3D11_SO_STREAM_COUNT];
    UINT                        m_NumSigs;
    UINT                        m_RasterizedStream;
};

//=================================================================================================================================
//
// Shader Feature Info blob
//
//  Structure:
//      A SShaderFeatureInfo.
//---------------------------------------------------------------------------------------------------------------------------------

#define SHADER_FEATURE_DOUBLES                                                        0x0001
#define SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x0002
#define SHADER_FEATURE_UAVS_AT_EVERY_STAGE                                            0x0004
#define SHADER_FEATURE_64_UAVS                                                        0x0008
#define SHADER_FEATURE_MINIMUM_PRECISION                                              0x0010
#define SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS                                         0x0020
#define SHADER_FEATURE_11_1_SHADER_EXTENSIONS                                         0x0040
#define SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING                                   0x0080
#define SHADER_FEATURE_TILED_RESOURCES                                                0x0100
#define SHADER_FEATURE_STENCIL_REF                                                    0x0200
#define SHADER_FEATURE_INNER_COVERAGE                                                 0x0400
#define SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS                              0x0800
#define SHADER_FEATURE_ROVS                                                           0x1000
#define SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x2000

// The bitfield below defines a set of optional bits for future use at the top end.  If a bit is set that is not
// in the optional range, the runtime fill fail shader creation.
#define D3D11_OPTIONAL_FEATURE_FLAGS         0x7FFFFF0000000000

struct SShaderFeatureInfo
{
    UINT64 FeatureFlags;
};


================================================
FILE: DxbcParser/include/pch.h
================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#pragma once

#include <d3d11_3.h>
#include <assert.h>

================================================
FILE: DxbcParser/src/BlobContainer.cpp
================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include <dxbcutils.h>

//=================================================================================================================================
// CDXBCParser

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::CDXBCParser
CDXBCParser::CDXBCParser()
{
    m_pHeader = NULL;
    m_pIndex = NULL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::ReadDXBC()
HRESULT CDXBCParser::ReadDXBC( const void* pContainer, UINT ContainerSizeInBytes )
{
    if (!pContainer)
    {
        return E_FAIL;
    }
    if (ContainerSizeInBytes < sizeof( DXBCHeader ))
    {
        return E_FAIL;
    }
    DXBCHeader* pHeader = (DXBCHeader*)pContainer;
    if (pHeader->ContainerSizeInBytes != ContainerSizeInBytes)
    {
        return E_FAIL;
    }
    if ((pHeader->DXBCHeaderFourCC != DXBC_FOURCC_NAME) ||
         (pHeader->Version.Major != DXBC_MAJOR_VERSION) ||
         (pHeader->Version.Minor != DXBC_MINOR_VERSION))
    {
        return E_FAIL;
    }
    const void* pContainerEnd = ((const BYTE*)pHeader + ContainerSizeInBytes);
    if (pContainerEnd < pContainer)
    {
        return E_FAIL;
    }
    UINT* pIndex = (UINT*)((BYTE*)pHeader + sizeof( DXBCHeader ));
    //CodeQL [SM03443] Intending to check for pointer overflow along with normal size checks
    if ((const BYTE*)pContainer + sizeof( UINT ) * pHeader->BlobCount < (const BYTE*)pContainer)
    {
        return E_FAIL; // overflow would break the calculation of OffsetOfCurrentSegmentEnd below
    }
    UINT OffsetOfCurrentSegmentEnd = (UINT)((BYTE*)pIndex - (const BYTE*)pContainer + sizeof( UINT ) * pHeader->BlobCount - 1);
    // Is the entire index within the container?
    if (OffsetOfCurrentSegmentEnd > ContainerSizeInBytes)
    {
        return E_FAIL;
    }
    // Is each blob in the index directly after the previous entry and not past the end of the container?
    UINT OffsetOfLastSegmentEnd = OffsetOfCurrentSegmentEnd;
    for (UINT b = 0; b < pHeader->BlobCount; b++)
    {
        DXBCBlobHeader* pBlobHeader = (DXBCBlobHeader*)((const BYTE*)pContainer + pIndex[b]);
        DXBCBlobHeader* pAfterBlobHeader = pBlobHeader + 1;

        if (pAfterBlobHeader < pBlobHeader || pAfterBlobHeader > pContainerEnd)
        {
            return E_FAIL;
        }
        if (((BYTE*)pBlobHeader < (const BYTE*)pContainer) || (pIndex[b] + sizeof( DXBCBlobHeader ) < pIndex[b]))
        {
            return E_FAIL; // overflow because of bad pIndex[b] value
        }
        if (pIndex[b] + sizeof( DXBCBlobHeader ) + pBlobHeader->BlobSize < pIndex[b])
        {
            return E_FAIL; // overflow because of bad pBlobHeader->BlobSize value
        }
        OffsetOfCurrentSegmentEnd = pIndex[b] + sizeof( DXBCBlobHeader ) + pBlobHeader->BlobSize - 1;
        if (OffsetOfCurrentSegmentEnd > ContainerSizeInBytes)
        {
            return E_FAIL;
        }
        if (OffsetOfLastSegmentEnd != pIndex[b] - 1)
        {
            return E_FAIL;
        }
        OffsetOfLastSegmentEnd = OffsetOfCurrentSegmentEnd;
    }

    // Ok, satisfied with integrity of container, store info.
    m_pHeader = pHeader;
    m_pIndex = pIndex;
    return S_OK;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::ReadDXBCAssumingValidSize()
HRESULT CDXBCParser::ReadDXBCAssumingValidSize( const void* pContainer )
{
    if (!pContainer)
    {
        return E_FAIL;
    }
    return ReadDXBC( (const BYTE*)pContainer, DXBCGetSizeAssumingValidPointer( (const BYTE*)pContainer ) );
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::FindNextMatchingBlob
UINT CDXBCParser::FindNextMatchingBlob( DXBCFourCC SearchFourCC, UINT SearchStartBlobIndex )
{
    if (!m_pHeader || !m_pIndex)
    {
        return (UINT)DXBC_BLOB_NOT_FOUND;
    }
    for (UINT b = SearchStartBlobIndex; b < m_pHeader->BlobCount; b++)
    {
        DXBCBlobHeader* pBlob = (DXBCBlobHeader*)((BYTE*)m_pHeader + m_pIndex[b]);
        if (pBlob->BlobFourCC == SearchFourCC)
        {
            return b;
        }
    }
    return (UINT)DXBC_BLOB_NOT_FOUND;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetVersion()
const DXBCVersion* CDXBCParser::GetVersion()
{
    return m_pHeader ? &m_pHeader->Version : NULL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetHash()
const DXBCHash* CDXBCParser::GetHash()
{
    return m_pHeader ? &m_pHeader->Hash : NULL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetBlobCount()
UINT CDXBCParser::GetBlobCount()
{
    return m_pHeader ? m_pHeader->BlobCount : 0;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetBlob()
const void* CDXBCParser::GetBlob( UINT BlobIndex )
{
    if (!m_pHeader || !m_pIndex || m_pHeader->BlobCount <= BlobIndex)
    {
        return NULL;
    }
    return (BYTE*)m_pHeader + m_pIndex[BlobIndex] + sizeof( DXBCBlobHeader );
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetBlobSize()
UINT CDXBCParser::GetBlobSize( UINT BlobIndex )
{
    if (!m_pHeader || !m_pIndex || m_pHeader->BlobCount <= BlobIndex)
    {
        return 0;
    }
    return ((DXBCBlobHeader*)((BYTE*)m_pHeader + m_pIndex[BlobIndex]))->BlobSize;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::GetBlobFourCC()
UINT CDXBCParser::GetBlobFourCC( UINT BlobIndex )
{
    if (!m_pHeader || !m_pIndex || m_pHeader->BlobCount <= BlobIndex)
    {
        return 0;
    }
    return ((DXBCBlobHeader*)((BYTE*)m_pHeader + m_pIndex[BlobIndex]))->BlobFourCC;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CDXBCParser::RelocateBytecode()
HRESULT CDXBCParser::RelocateBytecode( UINT_PTR ByteOffset )
{
    if (!m_pHeader || !m_pIndex)
    {
        // bad -- has not been initialized yet
        return E_FAIL;
    }
    m_pHeader = (const DXBCHeader*)((const BYTE*)m_pHeader + ByteOffset);
    m_pIndex = (const UINT32*)((const BYTE*)m_pIndex + ByteOffset);
    return S_OK;
}


================================================
FILE: DxbcParser/src/DXBCUtils.cpp
================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include <dxbcutils.h>

//---------------------------------------------------------------------------------------------------------------------------------
// DXBCGetSizeAssumingValidPointer()
UINT DXBCGetSizeAssumingValidPointer(const void* pDXBC)
{
    if( !pDXBC ) return 0;

    return *(UINT*)((const BYTE*)pDXBC + DXBCSizeOffset);
}

//---------------------------------------------------------------------------------------------------------------------------------
// DXBCGetInputSignature()
HRESULT DXBCGetInputSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference )
{
    CDXBCParser DXBCParser;
    HRESULT hr = S_OK;
    if( FAILED(hr = DXBCParser.ReadDXBCAssumingValidSize(pBlobContainer) ) )
    {
        return hr;
    }
    UINT BlobIndex = DXBCParser.FindNextMatchingBlob(DXBC_InputSignature11_1, 0);
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature11_1(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    BlobIndex = DXBCParser.FindNextMatchingBlob(DXBC_InputSignature, 0);
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature4(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    return E_FAIL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// DXBCGetOutputSignature()
HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignatureParser5* pParserToUse, bool bForceStringReference )
{
    CDXBCParser DXBCParser;
    HRESULT hr = S_OK;
    if( FAILED(hr = DXBCParser.ReadDXBCAssumingValidSize(pBlobContainer) ) )
    {
        return hr;
    }
    UINT BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_OutputSignature11_1, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature11_1(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_OutputSignature, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature4(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_OutputSignature5, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature5(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    return E_FAIL;
}

HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference)
{
    CDXBCParser DXBCParser;
    HRESULT hr = S_OK;
    if( FAILED(hr = DXBCParser.ReadDXBCAssumingValidSize(pBlobContainer) ) )
    {
        return hr;
    }
    UINT BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_OutputSignature11_1, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature11_1(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_OutputSignature, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND  )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature4(pUnParsedSignature, BlobSize, bForceStringReference);
    }
    return E_FAIL;
}

HRESULT DXBCGetPatchConstantSignature( const void* pBlobContainer, CSignatureParser* pParserToUse, bool bForceStringReference)
{
    CDXBCParser DXBCParser;
    HRESULT hr = S_OK;
    if( FAILED(hr = DXBCParser.ReadDXBCAssumingValidSize(pBlobContainer) ) )
    {
        return hr;
    }

    UINT BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_PatchConstantSignature11_1, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature11_1(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    BlobIndex = DXBCParser.FindNextMatchingBlob( DXBC_PatchConstantSignature, 0 );
    if( BlobIndex != DXBC_BLOB_NOT_FOUND )
    {
        const void* pUnParsedSignature = DXBCParser.GetBlob(BlobIndex);
        UINT BlobSize = DXBCParser.GetBlobSize(BlobIndex);
        if( !BlobSize )
        {
            return E_FAIL;
        }
        assert(pUnParsedSignature);
        return pParserToUse->ReadSignature4(pUnParsedSignature, BlobSize, bForceStringReference);
    }

    return E_FAIL;
}

//=================================================================================================================================
// CSignatureParser

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::Init()
void CSignatureParser::Init()
{
    m_pSignatureParameters = NULL;
    m_pSemanticNameCharSums = NULL;
    m_cParameters = 0;
    m_OwnParameters = TRUE;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::Cleanup()
void CSignatureParser::Cleanup()
{
    if( m_pSignatureParameters )
    {
        if( m_OwnParameters )
        {
            free(m_pSignatureParameters);
        }
        m_pSignatureParameters = NULL;
    }
    m_pSemanticNameCharSums = NULL;
    m_cParameters = 0;
    m_OwnParameters = TRUE;
}

//---------------------------------------------------------------------------------------------------------------------------------
// BoundedStringLength
//
// Safely returns length of null-terminated string pointed to by pBegin (not including null)
// given that the memory [ pBegin, pEnd ) is readable.
//
// Returns an error if pBegin doesn't point to a valid NT string.
//
HRESULT BoundedStringLength(__in_ecount(pEnd-pBegin) const char *pBegin,
                            const char *pEnd,
                            __out_ecount(1) UINT *pLength)
{
    if (pBegin >= pEnd)
    {
        // No readable memory!
        return E_FAIL;
    }

    const char *pc = pBegin;
    
    while (pc < pEnd && *pc)
    {
        ++pc;
    }

    if (pc == pEnd)
    {
        return E_FAIL;
    }

    assert(!*pc);

    *pLength = (UINT)(pc-pBegin);
    return S_OK;
}

typedef struct _D3D10_INTERNALSHADER_SIGNATURE
{
    UINT Parameters;      // Number of parameters
    UINT ParameterInfo;   // Offset to D3D10_INTERNALSHADER_PARAMETER[Parameters]
} D3D10_INTERNALSHADER_SIGNATURE, *LPD3D10_INTERNALSHADER_SIGNATURE;

typedef struct _D3D10_INTERNALSHADER_PARAMETER
{
    UINT SemanticName;                              // Offset to LPCSTR
    UINT SemanticIndex;                             // Semantic Index
    D3D10_NAME SystemValue;                         // Internally defined enumeration
    D3D10_REGISTER_COMPONENT_TYPE  ComponentType;   // Type of  of bits
    UINT Register;                                  // Register Index
    BYTE Mask;                                      // Combination of D3D10_COMPONENT_MASK values

    // The following unioned fields, NeverWrites_Mask and AlwaysReads_Mask, are exclusively used for 
    // output signatures or input signatures, respectively.
    //
    // For an output signature, NeverWrites_Mask indicates that the shader the signature belongs to never 
    // writes to the masked components of the output register.  Meaningful bits are the ones set in Mask above.
    //
    // For an input signature, AlwaysReads_Mask indicates that the shader the signature belongs to always
    // reads the masked components of the input register.  Meaningful bits are the ones set in the Mask above.
    //
    // This allows many shaders to share similar signatures even though some of them may not happen to use
    // all of the inputs/outputs - something which may not be obvious when authored.  The NeverWrites_Mask
    // and AlwaysReads_Mask can be checked in a debug layer at runtime for the one interesting case: that a 
    // shader that always reads a value is fed by a shader that always writes it.  Cases where shaders may
    // read values or may not cannot be validated unfortunately.  
    //
    // In scenarios where a signature is being passed around standalone (so it isn't tied to input or output 
    // of a given shader), this union can be zeroed out in the absence of more information.  This effectively
    // forces off linkage validation errors with the signature, since if interpreted as a input or output signature
    // somehow, since the meaning on output would be "everything is always written" and on input it would be 
    // "nothing is always read".
    union
    {
        BYTE NeverWrites_Mask;  // For an output signature, the shader the signature belongs to never 
                                // writes the masked components of the output register.
        BYTE AlwaysReads_Mask;  // For an input signature, the shader the signature belongs to always
                                // reads the masked components of the input register.
    };
} D3D10_INTERNALSHADER_PARAMETER, *LPD3D10_INTERNALSHADER_PARAMETER;

typedef struct _D3D11_INTERNALSHADER_PARAMETER_11_1
{
    UINT Stream;                                    // Stream index (parameters must appear in non-decreasing stream order)
    UINT SemanticName;                              // Offset to LPCSTR
    UINT SemanticIndex;                             // Semantic Index
    D3D10_NAME SystemValue;                         // Internally defined enumeration
    D3D10_REGISTER_COMPONENT_TYPE  ComponentType;   // Type of  of bits
    UINT Register;                                  // Register Index
    BYTE Mask;                                      // Combination of D3D10_COMPONENT_MASK values

    // The following unioned fields, NeverWrites_Mask and AlwaysReads_Mask, are exclusively used for 
    // output signatures or input signatures, respectively.
    //
    // For an output signature, NeverWrites_Mask indicates that the shader the signature belongs to never 
    // writes to the masked components of the output register.  Meaningful bits are the ones set in Mask above.
    //
    // For an input signature, AlwaysReads_Mask indicates that the shader the signature belongs to always
    // reads the masked components of the input register.  Meaningful bits are the ones set in the Mask above.
    //
    // This allows many shaders to share similar signatures even though some of them may not happen to use
    // all of the inputs/outputs - something which may not be obvious when authored.  The NeverWrites_Mask
    // and AlwaysReads_Mask can be checked in a debug layer at runtime for the one interesting case: that a 
    // shader that always reads a value is fed by a shader that always writes it.  Cases where shaders may
    // read values or may not cannot be validated unfortunately.  
    //
    // In scenarios where a signature is being passed around standalone (so it isn't tied to input or output 
    // of a given shader), this union can be zeroed out in the absence of more information.  This effectively
    // forces off linkage validation errors with the signature, since if interpreted as a input or output signature
    // somehow, since the meaning on output would be "everything is always written" and on input it would be 
    // "nothing is always read".
    union
    {
        BYTE NeverWrites_Mask;  // For an output signature, the shader the signature belongs to never 
                                // writes the masked components of the output register.
        BYTE AlwaysReads_Mask;  // For an input signature, the shader the signature belongs to always
                                // reads the masked components of the input register.
    };

    D3D_MIN_PRECISION MinPrecision;                 // Minimum precision of input/output data
} D3D11_INTERNALSHADER_PARAMETER_11_1, *LPD3D11_INTERNALSHADER_PARAMETER_11_1;

typedef struct _D3D11_INTERNALSHADER_PARAMETER_FOR_GS
{
    UINT Stream;                                    // Stream index (parameters must appear in non-decreasing stream order)
    UINT SemanticName;                              // Offset to LPCSTR
    UINT SemanticIndex;                             // Semantic Index
    D3D10_NAME SystemValue;                         // Internally defined enumeration
    D3D10_REGISTER_COMPONENT_TYPE  ComponentType;   // Type of  of bits
    UINT Register;                                  // Register Index
    BYTE Mask;                                      // Combination of D3D10_COMPONENT_MASK values

    // The following unioned fields, NeverWrites_Mask and AlwaysReads_Mask, are exclusively used for 
    // output signatures or input signatures, respectively.
    //
    // For an output signature, NeverWrites_Mask indicates that the shader the signature belongs to never 
    // writes to the masked components of the output register.  Meaningful bits are the ones set in Mask above.
    //
    // For an input signature, AlwaysReads_Mask indicates that the shader the signature belongs to always
    // reads the masked components of the input register.  Meaningful bits are the ones set in the Mask above.
    //
    // This allows many shaders to share similar signatures even though some of them may not happen to use
    // all of the inputs/outputs - something which may not be obvious when authored.  The NeverWrites_Mask
    // and AlwaysReads_Mask can be checked in a debug layer at runtime for the one interesting case: that a 
    // shader that always reads a value is fed by a shader that always writes it.  Cases where shaders may
    // read values or may not cannot be validated unfortunately.  
    //
    // In scenarios where a signature is being passed around standalone (so it isn't tied to input or output 
    // of a given shader), this union can be zeroed out in the absence of more information.  This effectively
    // forces off linkage validation errors with the signature, since if interpreted as a input or output signature
    // somehow, since the meaning on output would be "everything is always written" and on input it would be 
    // "nothing is always read".
    union
    {
        BYTE NeverWrites_Mask;  // For an output signature, the shader the signature belongs to never 
                                // writes the masked components of the output register.
        BYTE AlwaysReads_Mask;  // For an input signature, the shader the signature belongs to always
                                // reads the masked components of the input register.
    };
} D3D11_INTERNALSHADER_PARAMETER_FOR_GS, *LPD3D11_INTERNALSHADER_PARAMETER_FOR_GS;

inline D3D10_SB_NAME ConvertToSB(D3D10_NAME Value, UINT SemanticIndex)
{
    switch (Value)
    {
    case D3D10_NAME_TARGET:
    case D3D10_NAME_DEPTH:
    case D3D10_NAME_COVERAGE:
    case D3D10_NAME_UNDEFINED:
        return D3D10_SB_NAME_UNDEFINED;
    case D3D10_NAME_POSITION:
        return D3D10_SB_NAME_POSITION;
    case D3D10_NAME_CLIP_DISTANCE:
        return D3D10_SB_NAME_CLIP_DISTANCE;
    case D3D10_NAME_CULL_DISTANCE:
        return D3D10_SB_NAME_CULL_DISTANCE;
    case D3D10_NAME_RENDER_TARGET_ARRAY_INDEX:
        return D3D10_SB_NAME_RENDER_TARGET_ARRAY_INDEX;
    case D3D10_NAME_VIEWPORT_ARRAY_INDEX:
        return D3D10_SB_NAME_VIEWPORT_ARRAY_INDEX;
    case D3D10_NAME_VERTEX_ID:
        return D3D10_SB_NAME_VERTEX_ID;
    case D3D10_NAME_PRIMITIVE_ID:
        return D3D10_SB_NAME_PRIMITIVE_ID;
    case D3D10_NAME_INSTANCE_ID:
        return D3D10_SB_NAME_INSTANCE_ID;
    case D3D10_NAME_IS_FRONT_FACE:
        return D3D10_SB_NAME_IS_FRONT_FACE;
    case D3D10_NAME_SAMPLE_INDEX:
        return D3D10_SB_NAME_SAMPLE_INDEX;
    case D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 0:
            return D3D11_SB_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR;
        case 1:
            return D3D11_SB_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR;
        case 2:
            return D3D11_SB_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR;
        case 3:
            return D3D11_SB_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    case D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 0:
            return D3D11_SB_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR;
        case 1:
            return D3D11_SB_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    case D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 0:
            return D3D11_SB_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR;
        case 1:
            return D3D11_SB_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR;
        case 2:
            return D3D11_SB_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    case D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 0:
            return D3D11_SB_NAME_FINAL_TRI_INSIDE_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    case D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 1:
            return D3D11_SB_NAME_FINAL_LINE_DETAIL_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    case D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR:
        switch (SemanticIndex)
        {
        case 0:
            return D3D11_SB_NAME_FINAL_LINE_DENSITY_TESSFACTOR;
        }
        assert("Invalid D3D10_NAME");
        break;
    default:
        assert("Invalid D3D10_NAME");
    }
    // in retail the assert won't get hit and we'll just pass through anything bad.
    return (D3D10_SB_NAME)Value;
}
inline D3D10_SB_RESOURCE_DIMENSION ConvertToSB(D3D11_SRV_DIMENSION Value)
{

    switch (Value)
    {
    case D3D11_SRV_DIMENSION_UNKNOWN:
        return D3D10_SB_RESOURCE_DIMENSION_UNKNOWN;
    case D3D11_SRV_DIMENSION_BUFFER:
    case D3D11_SRV_DIMENSION_BUFFEREX:
        return D3D10_SB_RESOURCE_DIMENSION_BUFFER;
    case D3D11_SRV_DIMENSION_TEXTURE1D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE1D;
    case D3D11_SRV_DIMENSION_TEXTURE2D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2D;
    case D3D11_SRV_DIMENSION_TEXTURE2DMS:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMS;
    case D3D11_SRV_DIMENSION_TEXTURE3D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE3D;
    case D3D11_SRV_DIMENSION_TEXTURECUBE:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBE;
    case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBEARRAY;
    case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE1DARRAY;
    case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DARRAY;
    case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMSARRAY;
    default:
        assert("Invalid D3D11_RESOURCE_DIMENSION");
    }
    // in retail the assert won't get hit and we'll just pass through anything bad.
    return (D3D10_SB_RESOURCE_DIMENSION)Value;
}

inline D3D10_SB_RESOURCE_DIMENSION ConvertToSB(D3D11_UAV_DIMENSION Value)
{

    switch (Value)
    {
    case D3D11_UAV_DIMENSION_UNKNOWN:
        return D3D10_SB_RESOURCE_DIMENSION_UNKNOWN;
    case D3D11_UAV_DIMENSION_BUFFER:
        return D3D10_SB_RESOURCE_DIMENSION_BUFFER;
    case D3D11_UAV_DIMENSION_TEXTURE1D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE1D;
    case D3D11_UAV_DIMENSION_TEXTURE2D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2D;
    case D3D11_UAV_DIMENSION_TEXTURE3D:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE3D;
    case D3D11_UAV_DIMENSION_TEXTURE1DARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE1DARRAY;
    case D3D11_UAV_DIMENSION_TEXTURE2DARRAY:
        return D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DARRAY;
    default:
        assert("Invalid D3D11_RESOURCE_DIMENSION");
    }
    // in retail the assert won't get hit and we'll just pass through anything bad.
    return (D3D10_SB_RESOURCE_DIMENSION)Value;
}

inline D3D10_SB_REGISTER_COMPONENT_TYPE ConvertToSB(D3D10_REGISTER_COMPONENT_TYPE Value)
{

    switch (Value)
    {
    case D3D10_REGISTER_COMPONENT_UNKNOWN:
        return D3D10_SB_REGISTER_COMPONENT_UNKNOWN;
    case D3D10_REGISTER_COMPONENT_UINT32:
        return D3D10_SB_REGISTER_COMPONENT_UINT32;
    case D3D10_REGISTER_COMPONENT_SINT32:
        return D3D10_SB_REGISTER_COMPONENT_SINT32;
    case D3D10_REGISTER_COMPONENT_FLOAT32:
        return D3D10_SB_REGISTER_COMPONENT_FLOAT32;
    default:
        assert("Invalid D3D10_REGISTER_COMPONENT_TYPE");
    }
    // in retail the assert won't get hit and we'll just pass through anything bad.
    return (D3D10_SB_REGISTER_COMPONENT_TYPE)Value;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::ReadSignature()
HRESULT CSignatureParser::ReadSignature11_1( __in_bcount(BlobSize) const void* pSignature, UINT BlobSize, bool bForceStringReference )
{
    if( m_cParameters )
    {
        Cleanup();
    }
    if( !pSignature || BlobSize < sizeof(D3D10_INTERNALSHADER_SIGNATURE) )
    {
        return E_FAIL;
    }
    D3D10_INTERNALSHADER_SIGNATURE* pHeader = (D3D10_INTERNALSHADER_SIGNATURE*)pSignature;
    if( pHeader->Parameters == 0 )
    {
        m_cParameters = 0;
        return S_OK;
    }

    // If parameter count is less than MaxParameters calculation of SignatureAndParameterInfoSize will not overflow.
    const UINT MaxParameters = ((UINT_MAX - sizeof(D3D10_INTERNALSHADER_SIGNATURE)) / sizeof(D3D10_INTERNALSHADER_PARAMETER));

    if (pHeader->Parameters > MaxParameters)
    {
        return E_FAIL;
    }
    
    UINT ParameterInfoSize = pHeader->Parameters * sizeof(D3D11_INTERNALSHADER_PARAMETER_11_1);
    UINT SignatureAndParameterInfoSize = ParameterInfoSize + sizeof(D3D10_INTERNALSHADER_SIGNATURE);
    
    if (BlobSize < SignatureAndParameterInfoSize)
    {
        return E_FAIL;
    }

    // Keep end pointer around for checking
    const void *pEnd = static_cast<const BYTE*>(pSignature) + BlobSize;
    const D3D11_INTERNALSHADER_PARAMETER_11_1* pParameterInfo = (D3D11_INTERNALSHADER_PARAMETER_11_1*)((const BYTE*)pSignature + pHeader->ParameterInfo);
    UINT cParameters = pHeader->Parameters;
    UINT TotalStringLength = 0;
    UINT LastRegister = 0;
    for( UINT i = 0; i < cParameters; i++ )
    {
        UINT StringLength;
        if (FAILED(BoundedStringLength((const char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName),
                                       (const char*) pEnd,
                                        &StringLength)))
        {
            return E_FAIL;
        }
        if (!bForceStringReference)
        {
            TotalStringLength += StringLength + 1;
        }
        if( i > 0 )
        {
            // registers must show up in nondecreasing order in a signature
            if( LastRegister > pParameterInfo[i].Register )
            {
                return E_FAIL;
            }
        }
        LastRegister = pParameterInfo[i].Register;
    }
    UINT TotalParameterSize = pHeader->Parameters*sizeof(D3D11_SIGNATURE_PARAMETER);
    UINT TotalCharSumsSize = sizeof(UINT)*cParameters; // char sums for each SemanticName
    m_pSignatureParameters = (D3D11_SIGNATURE_PARAMETER*)malloc((TotalParameterSize + TotalCharSumsSize + TotalStringLength)*sizeof(BYTE));
    if( !m_pSignatureParameters )
    {
        return E_OUTOFMEMORY;
    }
    m_OwnParameters = TRUE;
    m_pSemanticNameCharSums = (UINT*)((BYTE*)m_pSignatureParameters + TotalParameterSize);
    char* pNextDstString = (char*)((BYTE*)m_pSemanticNameCharSums + TotalCharSumsSize);
    for( UINT i = 0; i < cParameters; i++ )
    {
        char* pNextSrcString = (char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName);

        m_pSignatureParameters[i].Stream = 0;
        m_pSignatureParameters[i].ComponentType = ConvertToSB(pParameterInfo[i].ComponentType);
        m_pSignatureParameters[i].Mask = pParameterInfo[i].Mask;
        m_pSignatureParameters[i].Register = pParameterInfo[i].Register;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].SystemValue = ConvertToSB(pParameterInfo[i].SystemValue,pParameterInfo[i].SemanticIndex);
        m_pSignatureParameters[i].SemanticName = bForceStringReference ? pNextSrcString : pNextDstString;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].NeverWrites_Mask = pParameterInfo[i].NeverWrites_Mask; // union with AlwaysReadMask
        m_pSignatureParameters[i].MinPrecision = pParameterInfo[i].MinPrecision;

        // This strlen was checked with BoundedStringLength in the first loop.
#pragma prefast( suppress : __WARNING_PRECONDITION_NULLTERMINATION_VIOLATION )
        UINT length = (UINT)strlen(pNextSrcString) + 1;

        if (!bForceStringReference)
        {
            // Calculation of TotalStringLength ensures that we have space in pNextDstString
#pragma prefast( suppress : __WARNING_POTENTIAL_BUFFER_OVERFLOW_LOOP_DEPENDENT )
            memcpy(pNextDstString, pNextSrcString, length);
            pNextDstString += length;
        }

        m_pSemanticNameCharSums[i] = 0;
        for( UINT j = 0; j < length; j++ )
        {
            m_pSemanticNameCharSums[i] += tolower(pNextSrcString[j]);
        }
    }
    m_cParameters = cParameters;
    return S_OK;
}


HRESULT CSignatureParser::ReadSignature4( __in_bcount(BlobSize) const void* pSignature, UINT BlobSize, bool bForceStringReference )
{
    if( m_cParameters )
    {
        Cleanup();
    }
    if( !pSignature || BlobSize < sizeof(D3D10_INTERNALSHADER_SIGNATURE) )
    {
        return E_FAIL;
    }
    D3D10_INTERNALSHADER_SIGNATURE* pHeader = (D3D10_INTERNALSHADER_SIGNATURE*)pSignature;
    if( pHeader->Parameters == 0 )
    {
        m_cParameters = 0;
        return S_OK;
    }

    // If parameter count is less than MaxParameters calculation of SignatureAndParameterInfoSize will not overflow.
    const UINT MaxParameters = ((UINT_MAX - sizeof(D3D10_INTERNALSHADER_SIGNATURE)) / sizeof(D3D10_INTERNALSHADER_PARAMETER));

    if (pHeader->Parameters > MaxParameters)
    {
        return E_FAIL;
    }
    
    UINT ParameterInfoSize = pHeader->Parameters * sizeof(D3D10_INTERNALSHADER_PARAMETER);
    UINT SignatureAndParameterInfoSize = ParameterInfoSize + sizeof(D3D10_INTERNALSHADER_SIGNATURE);
    
    if (BlobSize < SignatureAndParameterInfoSize)
    {
        return E_FAIL;
    }

    // Keep end pointer around for checking
    const void *pEnd = static_cast<const BYTE*>(pSignature) + BlobSize;
    const D3D10_INTERNALSHADER_PARAMETER* pParameterInfo = (D3D10_INTERNALSHADER_PARAMETER*)((const BYTE*)pSignature + pHeader->ParameterInfo);
    UINT cParameters = pHeader->Parameters;
    UINT TotalStringLength = 0;
    UINT LastRegister = 0;
    for( UINT i = 0; i < cParameters; i++ )
    {
        UINT StringLength;
        if (FAILED(BoundedStringLength((const char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName),
                                       (const char*) pEnd,
                                        &StringLength)))
        {
            return E_FAIL;
        }
        if (!bForceStringReference)
        {
            TotalStringLength += StringLength + 1;
        }
        if( i > 0 )
        {
            // registers must show up in nondecreasing order in a signature
            if( LastRegister > pParameterInfo[i].Register )
            {
                return E_FAIL;
            }
        }
        LastRegister = pParameterInfo[i].Register;
    }
    UINT TotalParameterSize = pHeader->Parameters*sizeof(D3D11_SIGNATURE_PARAMETER);
    UINT TotalCharSumsSize = sizeof(UINT)*cParameters; // char sums for each SemanticName
    m_pSignatureParameters = (D3D11_SIGNATURE_PARAMETER*)malloc((TotalParameterSize + TotalCharSumsSize + TotalStringLength)*sizeof(BYTE));
    if( !m_pSignatureParameters )
    {
        return E_OUTOFMEMORY;
    }
    m_OwnParameters = TRUE;
    m_pSemanticNameCharSums = (UINT*)((BYTE*)m_pSignatureParameters + TotalParameterSize);
    char* pNextDstString = (char*)((BYTE*)m_pSemanticNameCharSums + TotalCharSumsSize);
    for( UINT i = 0; i < cParameters; i++ )
    {
        char* pNextSrcString = (char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName);

        m_pSignatureParameters[i].Stream = 0;
        m_pSignatureParameters[i].ComponentType = ConvertToSB(pParameterInfo[i].ComponentType);
        m_pSignatureParameters[i].Mask = pParameterInfo[i].Mask;
        m_pSignatureParameters[i].Register = pParameterInfo[i].Register;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].SystemValue = ConvertToSB(pParameterInfo[i].SystemValue,pParameterInfo[i].SemanticIndex);
        m_pSignatureParameters[i].SemanticName = bForceStringReference ? pNextSrcString : pNextDstString;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].NeverWrites_Mask = pParameterInfo[i].NeverWrites_Mask; // union with AlwaysReadMask
        m_pSignatureParameters[i].MinPrecision = D3D_MIN_PRECISION_DEFAULT;

        // This strlen was checked with BoundedStringLength in the first loop.
#pragma prefast( suppress : __WARNING_PRECONDITION_NULLTERMINATION_VIOLATION )
        UINT length = (UINT)strlen(pNextSrcString) + 1;

        if (!bForceStringReference)
        {
            // Calculation of TotalStringLength ensures that we have space in pNextDstString
#pragma prefast( suppress : __WARNING_POTENTIAL_BUFFER_OVERFLOW_LOOP_DEPENDENT )
            memcpy(pNextDstString, pNextSrcString, length);
            pNextDstString += length;
        }

        m_pSemanticNameCharSums[i] = 0;
        for( UINT j = 0; j < length; j++ )
        {
            m_pSemanticNameCharSums[i] += tolower(pNextSrcString[j]);
        }
    }
    m_cParameters = cParameters;
    return S_OK;
}

HRESULT CSignatureParser::ReadSignature11_1( D3D11_SIGNATURE_PARAMETER* pParamList, UINT* pCharSums, UINT NumParameters )
{
    if( m_cParameters )
    {
        Cleanup();
    }
    if( !pParamList ) 
    {
        return S_OK;
    }

    m_pSignatureParameters = pParamList;
    m_pSemanticNameCharSums = pCharSums;
    m_cParameters = NumParameters;
    m_OwnParameters = FALSE;
    return S_OK;
}


HRESULT CSignatureParser::ReadSignature5( D3D11_SIGNATURE_PARAMETER* pParamList, UINT* pCharSums, UINT NumParameters )
{
    if( m_cParameters )
    {
        Cleanup();
    }
    if( !pParamList ) 
    {
        return S_OK;
    }

    m_pSignatureParameters = pParamList;
    m_pSemanticNameCharSums = pCharSums;
    m_cParameters = NumParameters;
    m_OwnParameters = FALSE;
    return S_OK;
}


//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser5::Init()
void CSignatureParser5::Init()
{
    m_NumSigs = 0;
    m_cParameters = 0;
    m_pSignatureParameters = NULL;
    m_RasterizedStream = 0;
    
    for( UINT i=0; i < D3D11_SO_STREAM_COUNT; i++ ) 
    {
        m_Sig[i].Init(); 
    }
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser5::Cleanup()
void CSignatureParser5::Cleanup()
{ 
    for( UINT i = 0; i < D3D11_SO_STREAM_COUNT; i++ ) 
    {
        if( m_Sig[i].m_cParameters )
        {
            m_Sig[i].Cleanup(); 
        }
    }
    if( m_pSignatureParameters )
    {
        free( m_pSignatureParameters );
        m_pSignatureParameters = NULL;
    }
    m_NumSigs = 0;
    m_RasterizedStream = 0;
    m_cParameters = 0;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::ReadSignature11_1()
HRESULT CSignatureParser5::ReadSignature11_1( __in_bcount(BlobSize) const void* pSignature, UINT BlobSize, bool bForceStringReference )
{
    Cleanup();
    if( !pSignature || BlobSize < sizeof(D3D10_INTERNALSHADER_SIGNATURE) )
    {
        return E_FAIL;
    }

    D3D10_INTERNALSHADER_SIGNATURE* pHeader = (D3D10_INTERNALSHADER_SIGNATURE*)pSignature;
    if( pHeader->Parameters == 0 )
    {
        m_cParameters = 0;
        return S_OK;
    }

    // If parameter count is less than MaxParameters calculation of SignatureAndParameterInfoSize will not overflow.
    const UINT MaxParameters = ((UINT_MAX - sizeof(D3D10_INTERNALSHADER_SIGNATURE)) / sizeof(D3D11_INTERNALSHADER_PARAMETER_11_1));

    if (pHeader->Parameters > MaxParameters)
    {
        return E_FAIL;
    }
    
    UINT ParameterInfoSize = pHeader->Parameters * sizeof(D3D11_INTERNALSHADER_PARAMETER_11_1);
    UINT SignatureAndParameterInfoSize = ParameterInfoSize + sizeof(D3D10_INTERNALSHADER_SIGNATURE);
    
    if (BlobSize < SignatureAndParameterInfoSize)
    {
        return E_FAIL;
    }

    // Keep end pointer around for checking
    const void *pEnd = static_cast<const BYTE*>(pSignature) + BlobSize;
    
    const D3D11_INTERNALSHADER_PARAMETER_11_1* pParameterInfo = (D3D11_INTERNALSHADER_PARAMETER_11_1*)((const BYTE*)pSignature + pHeader->ParameterInfo);
    UINT cParameters = pHeader->Parameters;
    UINT TotalStringLength = 0;
    UINT StreamParameters[D3D11_SO_STREAM_COUNT] = {0};
    UINT i = 0;
    for( UINT s = 0; s < D3D11_SO_STREAM_COUNT; s++ )
    {
        UINT LastRegister = 0;
        UINT FirstParameter = i;

        for( ; i < cParameters; i++ )
        {
            if( pParameterInfo[i].Stream != s )
            {
                break;
            }

            StreamParameters[s]++;
            UINT StringLength;
            if (FAILED(BoundedStringLength((const char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName),
                                           (const char*) pEnd,
                                            &StringLength)))
            {
                return E_FAIL;
            }
            if (!bForceStringReference)
            {
                TotalStringLength += StringLength + 1;
            }
            if( i > FirstParameter )
            {
                // registers must show up in nondecreasing order in a signature
                if( LastRegister > pParameterInfo[i].Register )
                {
                    return E_FAIL;
                }
            }
            LastRegister = pParameterInfo[i].Register;
            m_NumSigs = s + 1;
        }
    }
    UINT TotalParameterSize = pHeader->Parameters*sizeof(D3D11_SIGNATURE_PARAMETER);
    UINT TotalCharSumsSize = sizeof(UINT)*cParameters; // char sums for each SemanticName
    m_pSignatureParameters = (D3D11_SIGNATURE_PARAMETER*)malloc((TotalParameterSize + TotalCharSumsSize + TotalStringLength)*sizeof(BYTE));
    if( !m_pSignatureParameters )
    {
        return E_OUTOFMEMORY;
    }
    m_pSemanticNameCharSums = (UINT*)((BYTE*)m_pSignatureParameters + TotalParameterSize);
    char* pNextDstString = (char*)((BYTE*)m_pSemanticNameCharSums + TotalCharSumsSize);
    for( i = 0; i < cParameters; i++ )
    {
        char* pNextSrcString = (char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName);

        m_pSignatureParameters[i].Stream = pParameterInfo[i].Stream;
        m_pSignatureParameters[i].ComponentType = ConvertToSB(pParameterInfo[i].ComponentType);
        m_pSignatureParameters[i].Mask = pParameterInfo[i].Mask;
        m_pSignatureParameters[i].Register = pParameterInfo[i].Register;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].SystemValue = ConvertToSB(pParameterInfo[i].SystemValue,pParameterInfo[i].SemanticIndex);
        m_pSignatureParameters[i].SemanticName = bForceStringReference ? pNextSrcString : pNextDstString;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].NeverWrites_Mask = pParameterInfo[i].NeverWrites_Mask; // union with AlwaysReadMask
        m_pSignatureParameters[i].MinPrecision = pParameterInfo[i].MinPrecision;

        // This strlen was checked with BoundedStringLength in the first loop.
#pragma prefast( suppress : __WARNING_PRECONDITION_NULLTERMINATION_VIOLATION )
        UINT length = (UINT)strlen(pNextSrcString) + 1;

        if (!bForceStringReference)
        {
            __analysis_assume((char*)pNextDstString + length < (char*)m_pSignatureParameters + (TotalParameterSize + TotalCharSumsSize + TotalStringLength) * sizeof(BYTE));
            // Calculation of TotalStringLength ensures that we have space in pNextDstString
#pragma prefast( suppress : __WARNING_POTENTIAL_BUFFER_OVERFLOW_LOOP_DEPENDENT )
            memcpy(pNextDstString, pNextSrcString, length);
            pNextDstString += length;
        }

        m_pSemanticNameCharSums[i] = 0;
        for( UINT j = 0; j < length; j++ )
        {
            m_pSemanticNameCharSums[i] += tolower(pNextSrcString[j]);
        }
    }
    m_cParameters = cParameters;

    UINT PreviousParams = 0;
    for( i = 0; i < m_NumSigs; i++ )
    {
        m_Sig[i].ReadSignature11_1( &m_pSignatureParameters[PreviousParams], &m_pSemanticNameCharSums[PreviousParams], StreamParameters[i] );
        PreviousParams += StreamParameters[i];
    }

    return S_OK;
}


//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::ReadSignature5()
HRESULT CSignatureParser5::ReadSignature5( __in_bcount(BlobSize) const void* pSignature, UINT BlobSize, bool bForceStringReference )
{
    Cleanup();
    if( !pSignature || BlobSize < sizeof(D3D10_INTERNALSHADER_SIGNATURE) )
    {
        return E_FAIL;
    }

    D3D10_INTERNALSHADER_SIGNATURE* pHeader = (D3D10_INTERNALSHADER_SIGNATURE*)pSignature;
    if( pHeader->Parameters == 0 )
    {
        m_cParameters = 0;
        return S_OK;
    }

    // If parameter count is less than MaxParameters calculation of SignatureAndParameterInfoSize will not overflow.
    const UINT MaxParameters = ((UINT_MAX - sizeof(D3D10_INTERNALSHADER_SIGNATURE)) / sizeof(D3D11_INTERNALSHADER_PARAMETER_FOR_GS));

    if (pHeader->Parameters > MaxParameters)
    {
        return E_FAIL;
    }
    
    UINT ParameterInfoSize = pHeader->Parameters * sizeof(D3D11_INTERNALSHADER_PARAMETER_FOR_GS);
    UINT SignatureAndParameterInfoSize = ParameterInfoSize + sizeof(D3D10_INTERNALSHADER_SIGNATURE);
    
    if (BlobSize < SignatureAndParameterInfoSize)
    {
        return E_FAIL;
    }

    // Keep end pointer around for checking
    const void *pEnd = static_cast<const BYTE*>(pSignature) + BlobSize;
    
    const D3D11_INTERNALSHADER_PARAMETER_FOR_GS* pParameterInfo = (D3D11_INTERNALSHADER_PARAMETER_FOR_GS*)((const BYTE*)pSignature + pHeader->ParameterInfo);
    UINT cParameters = pHeader->Parameters;
    UINT TotalStringLength = 0;
    UINT StreamParameters[D3D11_SO_STREAM_COUNT] = {0};
    UINT i = 0;
    for( UINT s = 0; s < D3D11_SO_STREAM_COUNT; s++ )
    {
        UINT LastRegister = 0;
        UINT FirstParameter = i;

        for( ; i < cParameters; i++ )
        {
            if( pParameterInfo[i].Stream != s )
            {
                break;
            }

            StreamParameters[s]++;
            UINT StringLength;
            if (FAILED(BoundedStringLength((const char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName),
                                           (const char*) pEnd,
                                           &StringLength)))
            {
                return E_FAIL;
            }
            if (!bForceStringReference)
            {
                TotalStringLength += StringLength + 1;
            }
            if( i > FirstParameter )
            {
                // registers must show up in nondecreasing order in a signature
                if( LastRegister > pParameterInfo[i].Register )
                {
                    return E_FAIL;
                }
            }
            LastRegister = pParameterInfo[i].Register;
            m_NumSigs = s + 1;
        }
    }
    UINT TotalParameterSize = pHeader->Parameters*sizeof(D3D11_SIGNATURE_PARAMETER);
    UINT TotalCharSumsSize = sizeof(UINT)*cParameters; // char sums for each SemanticName
    m_pSignatureParameters = (D3D11_SIGNATURE_PARAMETER*)malloc((TotalParameterSize + TotalCharSumsSize + TotalStringLength)*sizeof(BYTE));
    if( !m_pSignatureParameters )
    {
        return E_OUTOFMEMORY;
    }
    m_pSemanticNameCharSums = (UINT*)((BYTE*)m_pSignatureParameters + TotalParameterSize);
    char* pNextDstString = (char*)((BYTE*)m_pSemanticNameCharSums + TotalCharSumsSize);
    for( i = 0; i < cParameters; i++ )
    {
        char* pNextSrcString = (char*)((const BYTE*)pSignature + pParameterInfo[i].SemanticName);

        m_pSignatureParameters[i].Stream = pParameterInfo[i].Stream;
        m_pSignatureParameters[i].ComponentType = ConvertToSB(pParameterInfo[i].ComponentType);
        m_pSignatureParameters[i].Mask = pParameterInfo[i].Mask;
        m_pSignatureParameters[i].Register = pParameterInfo[i].Register;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].SystemValue = ConvertToSB(pParameterInfo[i].SystemValue,pParameterInfo[i].SemanticIndex);
        m_pSignatureParameters[i].SemanticName = pNextDstString;
        m_pSignatureParameters[i].SemanticIndex = pParameterInfo[i].SemanticIndex;
        m_pSignatureParameters[i].NeverWrites_Mask = pParameterInfo[i].NeverWrites_Mask; // union with AlwaysReadMask
        m_pSignatureParameters[i].MinPrecision = D3D_MIN_PRECISION_DEFAULT;

        // This strlen was checked with BoundedStringLength in the first loop.
#pragma prefast( suppress : __WARNING_PRECONDITION_NULLTERMINATION_VIOLATION )
        UINT length = (UINT)strlen(pNextSrcString) + 1;

        if (!bForceStringReference)
        {
            __analysis_assume((char*)pNextDstString + length < (char*)m_pSignatureParameters + (TotalParameterSize + TotalCharSumsSize + TotalStringLength) * sizeof(BYTE));
            // Calculation of TotalStringLength ensures that we have space in pNextDstString
#pragma prefast( suppress : __WARNING_POTENTIAL_BUFFER_OVERFLOW_LOOP_DEPENDENT )
            memcpy(pNextDstString, pNextSrcString, length);
            pNextDstString += length;
        }

        m_pSemanticNameCharSums[i] = 0;
        for( UINT j = 0; j < length; j++ )
        {
            m_pSemanticNameCharSums[i] += tolower(pNextSrcString[j]);
        }
    }
    m_cParameters = cParameters;

    UINT PreviousParams = 0;
    for( i = 0; i < m_NumSigs; i++ )
    {
        m_Sig[i].ReadSignature5( &m_pSignatureParameters[PreviousParams], &m_pSemanticNameCharSums[PreviousParams], StreamParameters[i] );
        PreviousParams += StreamParameters[i];
    }

    return S_OK;
}

HRESULT CSignatureParser5::ReadSignature4( const void* pSignature, UINT BlobSize, bool bForceStringReference )
{
    Cleanup();
    if( !pSignature ) 
    {
        return E_FAIL;
    }

    if( FAILED( m_Sig[0].ReadSignature4( pSignature, BlobSize, bForceStringReference ) ) )
    {
        return E_FAIL;
    }

    m_pSignatureParameters = m_Sig[0].m_pSignatureParameters;
    m_Sig[0].m_OwnParameters = FALSE; // steal the signature from our child
    m_pSemanticNameCharSums = m_Sig[0].m_pSemanticNameCharSums;
    m_cParameters = m_Sig[0].m_cParameters;
    m_RasterizedStream = 0;
    m_NumSigs = 1;

    return S_OK;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::GetParameters()
UINT CSignatureParser::GetParameters( D3D11_SIGNATURE_PARAMETER const** ppParameters ) const
{
    if( ppParameters )
    {
        *ppParameters = m_pSignatureParameters;
    }
    return m_cParameters;
}

//---------------------------------------------------------------------------------------------------------------------------------
// LowerCaseCharSum
static UINT LowerCaseCharSum(LPCSTR pStr)
{
    if (!pStr)
        return 0;

    UINT sum = 0;
    while (*pStr != '\0')
    {
        sum += tolower(*pStr);
        pStr++;
    }
    return sum;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::FindParameter()
HRESULT CSignatureParser::FindParameter( LPCSTR SemanticName, UINT  SemanticIndex, 
                                         D3D11_SIGNATURE_PARAMETER** ppFoundParameter ) const
{
    UINT InputNameCharSum = LowerCaseCharSum(SemanticName);
    for(UINT i = 0; i < m_cParameters; i++ )
    {
        if( (SemanticIndex == m_pSignatureParameters[i].SemanticIndex) &&
            (InputNameCharSum == m_pSemanticNameCharSums[i]) &&
            (_stricmp(SemanticName,m_pSignatureParameters[i].SemanticName) == 0) )
        {
            if(ppFoundParameter) *ppFoundParameter = &m_pSignatureParameters[i];
            return S_OK;
        }
    }
    if(ppFoundParameter) *ppFoundParameter = NULL;
    return E_FAIL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::FindParameterRegister()
HRESULT CSignatureParser::FindParameterRegister( LPCSTR SemanticName, UINT  SemanticIndex, 
                                                 UINT* pFoundParameterRegister )
{
    UINT InputNameCharSum = LowerCaseCharSum(SemanticName);
    for(UINT i = 0; i < m_cParameters; i++ )
    {
        if( (SemanticIndex == m_pSignatureParameters[i].SemanticIndex) &&
            (InputNameCharSum == m_pSemanticNameCharSums[i]) &&
            (_stricmp(SemanticName,m_pSignatureParameters[i].SemanticName) == 0) )
        {
            if(pFoundParameterRegister) *pFoundParameterRegister = m_pSignatureParameters[i].Register;
            return S_OK;
        }
    }
    return E_FAIL;
}

//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::GetSemanticNameCharSum()
UINT CSignatureParser::GetSemanticNameCharSum( UINT parameter )
{
    if( parameter >= m_cParameters )
    {
        return 0;
    }
    return m_pSemanticNameCharSums[parameter];
}


//---------------------------------------------------------------------------------------------------------------------------------
// CSignatureParser::CanOutputTo()
bool CSignatureParser::CanOutputTo( CSignatureParser* pTargetSignature )
{
    if( !pTargetSignature )
    {
        return false;
    }
    const D3D11_SIGNATURE_PARAMETER* pDstParam;
    UINT cTargetParameters = pTargetSignature->GetParameters(&pDstParam);
    if( cTargetParameters > m_cParameters )
    {
        return false;
    }
    assert(cTargetParameters <= 64); // if cTargetParameters is allowed to be much larger, rethink this n^2 algorithm.
    for( UINT i = 0; i < cTargetParameters; i++ )
    {
        bool bFoundMatch = false;
        for( UINT j = 0; j < m_cParameters; j++ )
        {
            UINT srcIndex = (i + j) % m_cParameters; // start at the same location in the src as the dest, but loop through all.
            D3D11_SIGNATURE_PARAMETER* pSrcParam = &(m_pSignatureParameters[srcIndex]);
            if( ( m_pSemanticNameCharSums[srcIndex] == pTargetSignature->m_pSemanticNameCharSums[i] ) &&
                ( _stricmp(pSrcParam->SemanticName, pDstParam->SemanticName) == 0 ) &&
                ( pSrcParam->SemanticIndex == pDstParam->SemanticIndex ) &&
                ( pSrcParam->Register == pDstParam->Register ) &&
                ( pSrcParam->SystemValue == pDstParam->SystemValue ) &&
                ( pSrcParam->ComponentType == pDstParam->ComponentType ) &&
                ( ( pSrcParam->Mask & pDstParam->Mask ) == pDstParam->Mask ) &&
                // Check shader dependent read/write of input/output...
                // If the output shader never writes a value and the input always reads it, that's a problem:
                !((pSrcParam->NeverWrites_Mask & pSrcParam->Mask) & (pDstParam->AlwaysReads_Mask & pDstParam->Mask))
              )
            {
                bFoundMatch = true;
                break;
            }
        }
        if( !bFoundMatch )
        {
            return false;
        }
        pDstParam++;
    }

    return true;
}

//---------------------------------------------------------------------------------------------------------------------------------
// Clear out AlwaysReads_Mask / NeverWrites_Mask for all elements in the 
// signature to force the signature not to cause linkage errors when
// passing the signature around after extracting it from a shader.
void CSignatureParser::ClearAlwaysReadsNeverWritesMask()
{
    for( UINT i = 0; i < m_cParameters; i++ )
    {
        m_pSignatureParameters[i].NeverWrites_Mask = 0; // union with AlwaysReads_Mask
    }
}


================================================
FILE: LICENSE
================================================
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

================================================
FILE: README.md
================================================
# D3D12 Translation Layer

The D3D12 Translation Layer is a helper library for translating graphics concepts and commands from a D3D11-style domain to a D3D12-style domain.

A D3D11-style application generally:
* Records graphics commands in a single-threaded manner.
* Treats the CPU and GPU timeline as a single timeline. While there are some places where the asynchronicity of the GPU is exposed (e.g. queries or do-not-wait semantics), for the most part, a D3D11-style application can remain unaware of the fact that commands are recorded and executed at a later point in time.
  * Related to this is the fact that CPU-visible memory contents must be preserved from the time the CPU wrote them, until after the GPU has finished reading them in order to maintain the illusion of a single timeline.
* Creates individual state objects (e.g. blend state, rasterizer state) and compiles individual shaders, and only at the time when Draw is invoked does the application provide the full set of state which will be used.
* Ignore GPU parallelism and pipelining, trusting that driver introspection will maximize GPU utilization by parallelizing when possible, while preserving D3D11 semantics by synchronizing when necessary.

In contrast, a D3D12-style application must:
* Be aware of GPU asynchronicity, and manually synchronize the CPU and GPU.
* Be aware of GPU parallelism, and manually synchronize/barrier/transition resources from one usage to another.
* Manage memory, including allocation, deallocation, and "renaming" (discussed further below).
* Provide large bundles of state (called pipeline state objects in D3D12) all at once to enable cross-pipeline compilation and optimization.

To that end, this library provides an implementation of an API that looks like [D3D11](https://docs.microsoft.com/en-us/windows/win32/api/_direct3d11/), and submits work to [D3D12](https://docs.microsoft.com/en-us/windows/win32/api/_direct3d12/).

Make sure that you visit the [DirectX Landing Page](https://devblogs.microsoft.com/directx/landing-page/) for more resources for DirectX developers.

## Project Background

This project was started during the development of Windows 10 and D3D12. The Windows graphics team has a large set of D3D11 content which was heavily utilized during design and bringup of the D3D12 runtime and driver models. In order to use that content, a mapping layer, named D3D11On12, was developed.

This mapping layer proved successful and useful, to the point that a second mapping layer was developed, named D3D9On12. As the name implies, this maps from D3D9 to D3D12, and has to solve a lot of the same problems as D3D11On12. So, D3D11On12 was refactored into two pieces: a part that implements the D3D11-specific concepts, and a more general part that translates more traditional graphics constructs into a modern low-level D3D12 API consumer. This more general part is what became the D3D12TranslationLayer.

This code is currently being used by two mapping layers that ship as part of Windows: D3D11On12 and D3D9On12. In addition to the core D3D12TranslationLayer code, we also have released the source to D3D11On12, to serve as an example of how to consume this library.

## What does this do?

This translation layer provides the following high-level constructs (and more) for applications to use:

* Resource binding  
  The D3D12 resource binding model is quite different from D3D11 and prior. Rather than having a flat array of resources set on the pipeline which map 1:1 with shader registers, D3D12 takes a more flexible approach which is also closer to modern hardware. The translation layer takes care of figuring out which registers a shader needs, managing root signatures, populating descriptor heaps/tables, and setting up null descriptors for unbound resources.

* Resource renaming  
  D3D11 and older have a concept of `DISCARD` CPU access patterns, where the CPU populates a resource, instructs the GPU to read from it, and then immediately populates new contents without waiting for the GPU to read the old ones. This pattern is typically implemented via a pattern called "renaming", where new memory is allocated during the `DISCARD` operation, and all future references to that resource in the API will point to the new memory rather than the old. The translation layer provides a separation of a resource from its "identity," which enables cheap swapping of the underlying memory of a resource for that of another one without having to recreate views or rebind them. It also provides easy access to rename operations (allocate new memory with the same properties as the current, and swap their identities).

* Resource suballocation, pooling, and deferred destruction  
  D3D11-style apps can destroy objects immediately after instructing the GPU to do something with them. D3D12 requires applications to hold on to memory and GPU objects until the GPU has finished accessing them. Additionally, D3D11 apps suffer no penalty from allocating small resources (e.g. 16-byte buffers), where D3D12 apps must recognize that such small allocations are infeasible and should be suballocated from larger resources. Furthermore, constantly creating and destroying resources is a common pattern in D3D11, but in D3D12 this can quickly become expensive. The translation layer handles all of these abstractions seamlessly.

* Batching and threading  
  Since D3D11 patterns generally require applications to record all graphics commands on a single thread, there are often other CPU cores that are idle. To improve utilization, the translation layer provides a batching layer which can sit on top of the immediate context, moving the majority of work to a second thread so it can be parallelized. It also provides threadpool-based helpers for offloading PSO compilation to worker threads. Combining these means that compilations can be kicked off at draw-time on the application thread, and only the batching thread needs to wait for them to be completed. Meanwhile, other PSO compilations are starting or completing, minimizing the wall clock time spent compiling shaders.

* Residency management  
  This layer incorporates the open-source residency management library to improve utilization on low-memory systems.

## Building

This project produces a lib named D3D12TranslationLayer.lib. Additionally, if the [WDK](https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) is installed in addition to the Windows SDK, a second project for a second lib named D3D12TranslationLayer_WDK.lib will be created.

The D3D12TranslationLayer project requires C++17, and only supports building with MSVC at the moment.

## Contributing

This project welcomes contributions. See [CONTRIBUTING](CONTRIBUTING.md) for more information. Contributions to this project will flow back to the D3D11On12 and D3D9On12 mapping layers included in Windows 10.

## Roadmap

There are three items currently on the roadmap:
1. Refactoring for additional componentization - currently the translation layer is largely implemented by a monolithic class called the `ImmediateContext`. It would be difficult for an application consumer to pick and choose bits and pieces of functionality provided by this class, but that would be desirable to ease application porting to D3D12 while enabling the application to take on only those responsibilities with which they can achieve improved performance through app-specific information.  
A high-level thinking here is to require consumers to have an `ImmediateContext` object, and have sub-components that are registered with that context. For example, the resource state tracker component need not always be present, and applications could provide explicit resource barriers rather than relying on the `ImmediateContext` to do it for them.  
A key constraint on this componentization is that it should not negatively impact performance.
2. Supporting initial data upload on `D3D12_COMMAND_LIST_TYPE_COPY` for discrete GPUs, and using `WriteToSubresource` for UMA (integrated) GPUs. This should improve performance.
3. Supporting multi-GPU scenarios, specifically, using multiple nodes on a single D3D12 device. Currently, the D3D12TranslationLayer only supports one node, though it can be a node other than node 0.

Other suggestions or contributions are welcome.

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Specifically:  
The `g_hTracelogging` variable has events emitted against it with keywords which may trigger telemetry to be sent, depending on the configuration and registration of the tracelogging provider which is used. If no tracelogging provider is specified (using `D3D12TranslationLayer::SetTraceloggingProvider`) or if the specified provider is not configured for telemetry, then no telemetry will be sent. In the default configuration, no provider is created and no data is sent.


================================================
FILE: SECURITY.md
================================================
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
  * Full paths of source file(s) related to the manifestation of the issue
  * The location of the affected source code (tag/branch/commit or direct URL)
  * Any special configuration required to reproduce the issue
  * Step-by-step instructions to reproduce the issue
  * Proof-of-concept or exploit code (if possible)
  * Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->


================================================
FILE: external/MicrosoftTelemetry.h
================================================
/* ++

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE in the project root for license information.

Module Name:

    TraceLoggingConfig.h

Abstract:

    Macro definitions used by this project's TraceLogging ETW providers:

    - Configuration macros that select the ETW Provider Groups to be used by
      this project.
    - Constants for tags that are commonly used in Microsoft's
      TraceLogging-based ETW.

    Different versions of this file use different definitions for the
    TraceLoggingOption configuration macros. The definitions in this file are
    empty. As a result, providers using this configuration file will not join
    any ETW Provider Groups and will not be given any special treatment by
    group-sensitive ETW listeners.

Environment:

    User mode or kernel mode.

--*/

#pragma once

// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
// in this file configures the provider as a normal (non-telemetry) provider.
#define TraceLoggingOptionMicrosoftTelemetry() \
    // Empty definition for TraceLoggingOptionMicrosoftTelemetry

// Configuration macro for use in TRACELOGGING_DEFINE_PROVIDER. The definition
// in this file configures the provider as a normal (non-telemetry) provider.
#define TraceLoggingOptionWindowsCoreTelemetry() \
    // Empty definition for TraceLoggingOptionWindowsCoreTelemetry

// Event privacy tags. Use the PDT macro values for the tag parameter, e.g.:
// TraceLoggingWrite(...,
//   TelemetryPrivacyDataTag(PDT_BrowsingHistory | PDT_ProductAndServiceUsage),
//   ...);
#define TelemetryPrivacyDataTag(tag) TraceLoggingUInt64((tag), "PartA_PrivTags")
#define PDT_BrowsingHistory                    0x0000000000000002u
#define PDT_DeviceConnectivityAndConfiguration 0x0000000000000800u
#define PDT_InkingTypingAndSpeechUtterance     0x0000000000020000u
#define PDT_ProductAndServicePerformance       0x0000000001000000u
#define PDT_ProductAndServiceUsage             0x0000000002000000u
#define PDT_SoftwareSetupAndInventory          0x0000000080000000u

// Event categories specified via keywords, e.g.:
// TraceLoggingWrite(...,
//     TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
//     ...);
#define MICROSOFT_KEYWORD_CRITICAL_DATA 0x0000800000000000 // Bit 47
#define MICROSOFT_KEYWORD_MEASURES      0x0000400000000000 // Bit 46
#define MICROSOFT_KEYWORD_TELEMETRY     0x0000200000000000 // Bit 45
#define MICROSOFT_KEYWORD_RESERVED_44   0x0000100000000000 // Bit 44 (reserved for future assignment)

// Event categories specified via event tags, e.g.:
// TraceLoggingWrite(...,
//     TraceLoggingEventTag(MICROSOFT_EVENTTAG_REALTIME_LATENCY),
//     ...);
#define MICROSOFT_EVENTTAG_DROP_USER_IDS            0x00008000
#define MICROSOFT_EVENTTAG_AGGREGATE                0x00010000
#define MICROSOFT_EVENTTAG_DROP_PII_EXCEPT_IP       0x00020000
#define MICROSOFT_EVENTTAG_COSTDEFERRED_LATENCY     0x00040000
#define MICROSOFT_EVENTTAG_CORE_DATA                0x00080000
#define MICROSOFT_EVENTTAG_INJECT_XTOKEN            0x00100000
#define MICROSOFT_EVENTTAG_REALTIME_LATENCY         0x00200000
#define MICROSOFT_EVENTTAG_NORMAL_LATENCY           0x00400000
#define MICROSOFT_EVENTTAG_CRITICAL_PERSISTENCE     0x00800000
#define MICROSOFT_EVENTTAG_NORMAL_PERSISTENCE       0x01000000
#define MICROSOFT_EVENTTAG_DROP_PII                 0x02000000
#define MICROSOFT_EVENTTAG_HASH_PII                 0x04000000
#define MICROSOFT_EVENTTAG_MARK_PII                 0x08000000

// Field categories specified via field tags, e.g.:
// TraceLoggingWrite(...,
//     TraceLoggingString(szUser, "UserName", "User's name", MICROSOFT_FIELDTAG_HASH_PII),
//     ...);
#define MICROSOFT_FIELDTAG_DROP_PII 0x04000000
#define MICROSOFT_FIELDTAG_HASH_PII 0x08000000


================================================
FILE: external/d3d12compatibility.h
================================================
/*-------------------------------------------------------------------------------------
 *
 * Copyright (c) Microsoft Corporation
 *
 *-------------------------------------------------------------------------------------*/


/* this ALWAYS GENERATED file contains the definitions for the interfaces */


 /* File created by MIDL compiler version 8.01.0622 */



/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif

/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif

#include "rpc.h"
#include "rpcndr.h"

#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */

#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/

#ifndef __d3d12compatibility_h__
#define __d3d12compatibility_h__

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

/* Forward Declarations */ 

#ifndef __ID3D12CompatibilityDevice_FWD_DEFINED__
#define __ID3D12CompatibilityDevice_FWD_DEFINED__
typedef interface ID3D12CompatibilityDevice ID3D12CompatibilityDevice;

#endif 	/* __ID3D12CompatibilityDevice_FWD_DEFINED__ */


#ifndef __ID3D12CompatibilityQueue_FWD_DEFINED__
#define __ID3D12CompatibilityQueue_FWD_DEFINED__
typedef interface ID3D12CompatibilityQueue ID3D12CompatibilityQueue;

#endif 	/* __ID3D12CompatibilityQueue_FWD_DEFINED__ */


/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#include "d3d11on12.h"

#ifdef __cplusplus
extern "C"{
#endif 


/* interface __MIDL_itf_d3d12compatibility_0000_0000 */
/* [local] */ 

#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
typedef 
enum D3D12_COMPATIBILITY_SHARED_FLAGS
    {
        D3D12_COMPATIBILITY_SHARED_FLAG_NONE	= 0,
        D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE	= 0x1,
        D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX	= 0x2,
        D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12	= 0x4
    } 	D3D12_COMPATIBILITY_SHARED_FLAGS;

DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS );
typedef 
enum D3D12_REFLECT_SHARED_PROPERTY
    {
        D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS	= 0,
        D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS	= ( D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1 ) ,
        D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE	= ( D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS + 1 ) 
    } 	D3D12_REFLECT_SHARED_PROPERTY;



extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_s_ifspec;

#ifndef __ID3D12CompatibilityDevice_INTERFACE_DEFINED__
#define __ID3D12CompatibilityDevice_INTERFACE_DEFINED__

/* interface ID3D12CompatibilityDevice */
/* [unique][local][object][uuid] */ 


EXTERN_C const IID IID_ID3D12CompatibilityDevice;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("8f1c0e3c-fae3-4a82-b098-bfe1708207ff")
    ID3D12CompatibilityDevice : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE CreateSharedResource( 
            _In_  const D3D12_HEAP_PROPERTIES *pHeapProperties,
            D3D12_HEAP_FLAGS HeapFlags,
            _In_  const D3D12_RESOURCE_DESC *pDesc,
            D3D12_RESOURCE_STATES InitialResourceState,
            _In_opt_  const D3D12_CLEAR_VALUE *pOptimizedClearValue,
            _In_opt_  const D3D11_RESOURCE_FLAGS *pFlags11,
            D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
            _In_opt_  ID3D12LifetimeTracker *pLifetimeTracker,
            _In_opt_  ID3D12SwapChainAssistant *pOwningSwapchain,
            REFIID riid,
            _COM_Outptr_opt_  void **ppResource) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE CreateSharedHeap( 
            _In_  const D3D12_HEAP_DESC *pHeapDesc,
            D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
            REFIID riid,
            _COM_Outptr_opt_  void **ppHeap) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE ReflectSharedProperties( 
            _In_  ID3D12Object *pHeapOrResource,
            D3D12_REFLECT_SHARED_PROPERTY ReflectType,
            _Out_writes_bytes_(DataSize)  void *pData,
            UINT DataSize) = 0;
        
    };
    
    
#else 	/* C style interface */

    typedef struct ID3D12CompatibilityDeviceVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            ID3D12CompatibilityDevice * This,
            REFIID riid,
            _COM_Outptr_  void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            ID3D12CompatibilityDevice * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            ID3D12CompatibilityDevice * This);
        
        HRESULT ( STDMETHODCALLTYPE *CreateSharedResource )( 
            ID3D12CompatibilityDevice * This,
            _In_  const D3D12_HEAP_PROPERTIES *pHeapProperties,
            D3D12_HEAP_FLAGS HeapFlags,
            _In_  const D3D12_RESOURCE_DESC *pDesc,
            D3D12_RESOURCE_STATES InitialResourceState,
            _In_opt_  const D3D12_CLEAR_VALUE *pOptimizedClearValue,
            _In_opt_  const D3D11_RESOURCE_FLAGS *pFlags11,
            D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
            _In_opt_  ID3D12LifetimeTracker *pLifetimeTracker,
            _In_opt_  ID3D12SwapChainAssistant *pOwningSwapchain,
            REFIID riid,
            _COM_Outptr_opt_  void **ppResource);
        
        HRESULT ( STDMETHODCALLTYPE *CreateSharedHeap )( 
            ID3D12CompatibilityDevice * This,
            _In_  const D3D12_HEAP_DESC *pHeapDesc,
            D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
            REFIID riid,
            _COM_Outptr_opt_  void **ppHeap);
        
        HRESULT ( STDMETHODCALLTYPE *ReflectSharedProperties )( 
            ID3D12CompatibilityDevice * This,
            _In_  ID3D12Object *pHeapOrResource,
            D3D12_REFLECT_SHARED_PROPERTY ReflectType,
            _Out_writes_bytes_(DataSize)  void *pData,
            UINT DataSize);
        
        END_INTERFACE
    } ID3D12CompatibilityDeviceVtbl;

    interface ID3D12CompatibilityDevice
    {
        CONST_VTBL struct ID3D12CompatibilityDeviceVtbl *lpVtbl;
    };

    

#ifdef COBJMACROS


#define ID3D12CompatibilityDevice_QueryInterface(This,riid,ppvObject)	\
    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

#define ID3D12CompatibilityDevice_AddRef(This)	\
    ( (This)->lpVtbl -> AddRef(This) ) 

#define ID3D12CompatibilityDevice_Release(This)	\
    ( (This)->lpVtbl -> Release(This) ) 


#define ID3D12CompatibilityDevice_CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource)	\
    ( (This)->lpVtbl -> CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) ) 

#define ID3D12CompatibilityDevice_CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap)	\
    ( (This)->lpVtbl -> CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) ) 

#define ID3D12CompatibilityDevice_ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize)	\
    ( (This)->lpVtbl -> ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) ) 

#endif /* COBJMACROS */


#endif 	/* C style interface */




#endif 	/* __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ */


#ifndef __ID3D12CompatibilityQueue_INTERFACE_DEFINED__
#define __ID3D12CompatibilityQueue_INTERFACE_DEFINED__

/* interface ID3D12CompatibilityQueue */
/* [unique][local][object][uuid] */ 


EXTERN_C const IID IID_ID3D12CompatibilityQueue;

#if defined(__cplusplus) && !defined(CINTERFACE)
    
    MIDL_INTERFACE("7974c836-9520-4cda-8d43-d996622e8926")
    ID3D12CompatibilityQueue : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE AcquireKeyedMutex( 
            _In_  ID3D12Object *pHeapOrResourceWithKeyedMutex,
            UINT64 Key,
            DWORD dwTimeout,
            _Reserved_  void *pReserved,
            _In_range_(0,0)  UINT Reserved) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE ReleaseKeyedMutex( 
            _In_  ID3D12Object *pHeapOrResourceWithKeyedMutex,
            UINT64 Key,
            _Reserved_  void *pReserved,
            _In_range_(0,0)  UINT Reserved) = 0;
        
    };
    
    
#else 	/* C style interface */

    typedef struct ID3D12CompatibilityQueueVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            ID3D12CompatibilityQueue * This,
            REFIID riid,
            _COM_Outptr_  void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            ID3D12CompatibilityQueue * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            ID3D12CompatibilityQueue * This);
        
        HRESULT ( STDMETHODCALLTYPE *AcquireKeyedMutex )( 
            ID3D12CompatibilityQueue * This,
            _In_  ID3D12Object *pHeapOrResourceWithKeyedMutex,
            UINT64 Key,
            DWORD dwTimeout,
            _Reserved_  void *pReserved,
            _In_range_(0,0)  UINT Reserved);
        
        HRESULT ( STDMETHODCALLTYPE *ReleaseKeyedMutex )( 
            ID3D12CompatibilityQueue * This,
            _In_  ID3D12Object *pHeapOrResourceWithKeyedMutex,
            UINT64 Key,
            _Reserved_  void *pReserved,
            _In_range_(0,0)  UINT Reserved);
        
        END_INTERFACE
    } ID3D12CompatibilityQueueVtbl;

    interface ID3D12CompatibilityQueue
    {
        CONST_VTBL struct ID3D12CompatibilityQueueVtbl *lpVtbl;
    };

    

#ifdef COBJMACROS


#define ID3D12CompatibilityQueue_QueryInterface(This,riid,ppvObject)	\
    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 

#define ID3D12CompatibilityQueue_AddRef(This)	\
    ( (This)->lpVtbl -> AddRef(This) ) 

#define ID3D12CompatibilityQueue_Release(This)	\
    ( (This)->lpVtbl -> Release(This) ) 


#define ID3D12CompatibilityQueue_AcquireKeyedMutex(This,pHeapOrResourceWithKeyedMutex,Key,dwTimeout,pReserved,Reserved)	\
    ( (This)->lpVtbl -> AcquireKeyedMutex(This,pHeapOrResourceWithKeyedMutex,Key,dwTimeout,pReserved,Reserved) ) 

#define ID3D12CompatibilityQueue_ReleaseKeyedMutex(This,pHeapOrResourceWithKeyedMutex,Key,pReserved,Reserved)	\
    ( (This)->lpVtbl -> ReleaseKeyedMutex(This,pHeapOrResourceWithKeyedMutex,Key,pReserved,Reserved) ) 

#endif /* COBJMACROS */


#endif 	/* C style interface */




#endif 	/* __ID3D12CompatibilityQueue_INTERFACE_DEFINED__ */


/* interface __MIDL_itf_d3d12compatibility_0000_0002 */
/* [local] */ 

#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff);
DEFINE_GUID(IID_ID3D12CompatibilityQueue,0x7974c836,0x9520,0x4cda,0x8d,0x43,0xd9,0x96,0x62,0x2e,0x89,0x26);


extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0002_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0002_v0_0_s_ifspec;

/* Additional Prototypes for ALL interfaces */

/* end of Additional Prototypes */

#ifdef __cplusplus
}
#endif

#endif




================================================
FILE: external/d3dx12.h
================================================
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

#ifndef __D3DX12_H__
#define __D3DX12_H__

#include "d3d12.h"

#if defined( __cplusplus )

struct CD3DX12_DEFAULT {};
extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT;

//------------------------------------------------------------------------------------------------
inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
{
    return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width &&
        l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth;
}

//------------------------------------------------------------------------------------------------
inline bool operator!=( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_RECT : public D3D12_RECT
{
    CD3DX12_RECT() = default;
    explicit CD3DX12_RECT( const D3D12_RECT& o ) :
        D3D12_RECT( o )
    {}
    explicit CD3DX12_RECT(
        LONG Left,
        LONG Top,
        LONG Right,
        LONG Bottom )
    {
        left = Left;
        top = Top;
        right = Right;
        bottom = Bottom;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT
{
    CD3DX12_VIEWPORT() = default;
    explicit CD3DX12_VIEWPORT( const D3D12_VIEWPORT& o ) :
        D3D12_VIEWPORT( o )
    {}
    explicit CD3DX12_VIEWPORT(
        FLOAT topLeftX,
        FLOAT topLeftY,
        FLOAT width,
        FLOAT height,
        FLOAT minDepth = D3D12_MIN_DEPTH,
        FLOAT maxDepth = D3D12_MAX_DEPTH )
    {
        TopLeftX = topLeftX;
        TopLeftY = topLeftY;
        Width = width;
        Height = height;
        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
    explicit CD3DX12_VIEWPORT(
        _In_ ID3D12Resource* pResource,
        UINT mipSlice = 0,
        FLOAT topLeftX = 0.0f,
        FLOAT topLeftY = 0.0f,
        FLOAT minDepth = D3D12_MIN_DEPTH,
        FLOAT maxDepth = D3D12_MAX_DEPTH )
    {
        auto Desc = pResource->GetDesc();
        const UINT64 SubresourceWidth = Desc.Width >> mipSlice;
        const UINT64 SubresourceHeight = Desc.Height >> mipSlice;
        switch (Desc.Dimension)
        {
        case D3D12_RESOURCE_DIMENSION_BUFFER:
            TopLeftX = topLeftX;
            TopLeftY = 0.0f;
            Width = Desc.Width - topLeftX;
            Height = 1.0f;
            break;
        case D3D12_RESOURCE_DIMENSION_TEXTURE1D:
            TopLeftX = topLeftX;
            TopLeftY = 0.0f;
            Width = (SubresourceWidth ? SubresourceWidth : 1.0f) - topLeftX;
            Height = 1.0f;
            break;
        case D3D12_RESOURCE_DIMENSION_TEXTURE2D:
        case D3D12_RESOURCE_DIMENSION_TEXTURE3D:
            TopLeftX = topLeftX;
            TopLeftY = topLeftY;
            Width = (SubresourceWidth ? SubresourceWidth : 1.0f) - topLeftX;
            Height = (SubresourceHeight ? SubresourceHeight: 1.0f) - topLeftY;
            break;
        default: break;
        }

        MinDepth = minDepth;
        MaxDepth = maxDepth;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_BOX : public D3D12_BOX
{
    CD3DX12_BOX() = default;
    explicit CD3DX12_BOX( const D3D12_BOX& o ) :
        D3D12_BOX( o )
    {}
    explicit CD3DX12_BOX(
        LONG Left,
        LONG Right )
    {
        left = static_cast<UINT>(Left);
        top = 0;
        front = 0;
        right = static_cast<UINT>(Right);
        bottom = 1;
        back = 1;
    }
    explicit CD3DX12_BOX(
        LONG Left,
        LONG Top,
        LONG Right,
        LONG Bottom )
    {
        left = static_cast<UINT>(Left);
        top = static_cast<UINT>(Top);
        front = 0;
        right = static_cast<UINT>(Right);
        bottom = static_cast<UINT>(Bottom);
        back = 1;
    }
    explicit CD3DX12_BOX(
        LONG Left,
        LONG Top,
        LONG Front,
        LONG Right,
        LONG Bottom,
        LONG Back )
    {
        left = static_cast<UINT>(Left);
        top = static_cast<UINT>(Top);
        front = static_cast<UINT>(Front);
        right = static_cast<UINT>(Right);
        bottom = static_cast<UINT>(Bottom);
        back = static_cast<UINT>(Back);
    }
};
inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r )
{
    return l.left == r.left && l.top == r.top && l.front == r.front &&
        l.right == r.right && l.bottom == r.bottom && l.back == r.back;
}
inline bool operator!=( const D3D12_BOX& l, const D3D12_BOX& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC
{
    CD3DX12_DEPTH_STENCIL_DESC() = default;
    explicit CD3DX12_DEPTH_STENCIL_DESC( const D3D12_DEPTH_STENCIL_DESC& o ) :
        D3D12_DEPTH_STENCIL_DESC( o )
    {}
    explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT )
    {
        DepthEnable = TRUE;
        DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
        DepthFunc = D3D12_COMPARISON_FUNC_LESS;
        StencilEnable = FALSE;
        StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK;
        StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK;
        const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp =
        { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS };
        FrontFace = defaultStencilOp;
        BackFace = defaultStencilOp;
    }
    explicit CD3DX12_DEPTH_STENCIL_DESC(
        BOOL depthEnable,
        D3D12_DEPTH_WRITE_MASK depthWriteMask,
        D3D12_COMPARISON_FUNC depthFunc,
        BOOL stencilEnable,
        UINT8 stencilReadMask,
        UINT8 stencilWriteMask,
        D3D12_STENCIL_OP frontStencilFailOp,
        D3D12_STENCIL_OP frontStencilDepthFailOp,
        D3D12_STENCIL_OP frontStencilPassOp,
        D3D12_COMPARISON_FUNC frontStencilFunc,
        D3D12_STENCIL_OP backStencilFailOp,
        D3D12_STENCIL_OP backStencilDepthFailOp,
        D3D12_STENCIL_OP backStencilPassOp,
        D3D12_COMPARISON_FUNC backStencilFunc )
    {
        DepthEnable = depthEnable;
        DepthWriteMask = depthWriteMask;
        DepthFunc = depthFunc;
        StencilEnable = stencilEnable;
        StencilReadMask = stencilReadMask;
        StencilWriteMask = stencilWriteMask;
        FrontFace.StencilFailOp = frontStencilFailOp;
        FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
        FrontFace.StencilPassOp = frontStencilPassOp;
        FrontFace.StencilFunc = frontStencilFunc;
        BackFace.StencilFailOp = backStencilFailOp;
        BackFace.StencilDepthFailOp = backStencilDepthFailOp;
        BackFace.StencilPassOp = backStencilPassOp;
        BackFace.StencilFunc = backStencilFunc;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1
{
    CD3DX12_DEPTH_STENCIL_DESC1() = default;
    explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC1& o ) :
        D3D12_DEPTH_STENCIL_DESC1( o )
    {}
    explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC& o )
    {
        DepthEnable                  = o.DepthEnable;
        DepthWriteMask               = o.DepthWriteMask;
        DepthFunc                    = o.DepthFunc;
        StencilEnable                = o.StencilEnable;
        StencilReadMask              = o.StencilReadMask;
        StencilWriteMask             = o.StencilWriteMask;
        FrontFace.StencilFailOp      = o.FrontFace.StencilFailOp;
        FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp;
        FrontFace.StencilPassOp      = o.FrontFace.StencilPassOp;
        FrontFace.StencilFunc        = o.FrontFace.StencilFunc;
        BackFace.StencilFailOp       = o.BackFace.StencilFailOp;
        BackFace.StencilDepthFailOp  = o.BackFace.StencilDepthFailOp;
        BackFace.StencilPassOp       = o.BackFace.StencilPassOp;
        BackFace.StencilFunc         = o.BackFace.StencilFunc;
        DepthBoundsTestEnable        = FALSE;
    }
    explicit CD3DX12_DEPTH_STENCIL_DESC1( CD3DX12_DEFAULT )
    {
        DepthEnable = TRUE;
        DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
        DepthFunc = D3D12_COMPARISON_FUNC_LESS;
        StencilEnable = FALSE;
        StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK;
        StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK;
        const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp =
        { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS };
        FrontFace = defaultStencilOp;
        BackFace = defaultStencilOp;
        DepthBoundsTestEnable = FALSE;
    }
    explicit CD3DX12_DEPTH_STENCIL_DESC1(
        BOOL depthEnable,
        D3D12_DEPTH_WRITE_MASK depthWriteMask,
        D3D12_COMPARISON_FUNC depthFunc,
        BOOL stencilEnable,
        UINT8 stencilReadMask,
        UINT8 stencilWriteMask,
        D3D12_STENCIL_OP frontStencilFailOp,
        D3D12_STENCIL_OP frontStencilDepthFailOp,
        D3D12_STENCIL_OP frontStencilPassOp,
        D3D12_COMPARISON_FUNC frontStencilFunc,
        D3D12_STENCIL_OP backStencilFailOp,
        D3D12_STENCIL_OP backStencilDepthFailOp,
        D3D12_STENCIL_OP backStencilPassOp,
        D3D12_COMPARISON_FUNC backStencilFunc,
        BOOL depthBoundsTestEnable )
    {
        DepthEnable = depthEnable;
        DepthWriteMask = depthWriteMask;
        DepthFunc = depthFunc;
        StencilEnable = stencilEnable;
        StencilReadMask = stencilReadMask;
        StencilWriteMask = stencilWriteMask;
        FrontFace.StencilFailOp = frontStencilFailOp;
        FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
        FrontFace.StencilPassOp = frontStencilPassOp;
        FrontFace.StencilFunc = frontStencilFunc;
        BackFace.StencilFailOp = backStencilFailOp;
        BackFace.StencilDepthFailOp = backStencilDepthFailOp;
        BackFace.StencilPassOp = backStencilPassOp;
        BackFace.StencilFunc = backStencilFunc;
        DepthBoundsTestEnable = depthBoundsTestEnable;
    }
    operator D3D12_DEPTH_STENCIL_DESC() const
    {
        D3D12_DEPTH_STENCIL_DESC D;
        D.DepthEnable                  = DepthEnable;
        D.DepthWriteMask               = DepthWriteMask;
        D.DepthFunc                    = DepthFunc;
        D.StencilEnable                = StencilEnable;
        D.StencilReadMask              = StencilReadMask;
        D.StencilWriteMask             = StencilWriteMask;
        D.FrontFace.StencilFailOp      = FrontFace.StencilFailOp;
        D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp;
        D.FrontFace.StencilPassOp      = FrontFace.StencilPassOp;
        D.FrontFace.StencilFunc        = FrontFace.StencilFunc;
        D.BackFace.StencilFailOp       = BackFace.StencilFailOp;
        D.BackFace.StencilDepthFailOp  = BackFace.StencilDepthFailOp;
        D.BackFace.StencilPassOp       = BackFace.StencilPassOp;
        D.BackFace.StencilFunc         = BackFace.StencilFunc;
        return D;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC
{
    CD3DX12_BLEND_DESC() = default;
    explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) :
        D3D12_BLEND_DESC( o )
    {}
    explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT )
    {
        AlphaToCoverageEnable = FALSE;
        IndependentBlendEnable = FALSE;
        const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc =
        {
            FALSE,FALSE,
            D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
            D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
            D3D12_LOGIC_OP_NOOP,
            D3D12_COLOR_WRITE_ENABLE_ALL,
        };
        for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
            RenderTarget[ i ] = defaultRenderTargetBlendDesc;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC
{
    CD3DX12_RASTERIZER_DESC() = default;
    explicit CD3DX12_RASTERIZER_DESC( const D3D12_RASTERIZER_DESC& o ) :
        D3D12_RASTERIZER_DESC( o )
    {}
    explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT )
    {
        FillMode = D3D12_FILL_MODE_SOLID;
        CullMode = D3D12_CULL_MODE_BACK;
        FrontCounterClockwise = FALSE;
        DepthBias = D3D12_DEFAULT_DEPTH_BIAS;
        DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP;
        SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
        DepthClipEnable = TRUE;
        MultisampleEnable = FALSE;
        AntialiasedLineEnable = FALSE;
        ForcedSampleCount = 0;
        ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
    }
    explicit CD3DX12_RASTERIZER_DESC(
        D3D12_FILL_MODE fillMode,
        D3D12_CULL_MODE cullMode,
        BOOL frontCounterClockwise,
        INT depthBias,
        FLOAT depthBiasClamp,
        FLOAT slopeScaledDepthBias,
        BOOL depthClipEnable,
        BOOL multisampleEnable,
        BOOL antialiasedLineEnable, 
        UINT forcedSampleCount, 
        D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster)
    {
        FillMode = fillMode;
        CullMode = cullMode;
        FrontCounterClockwise = frontCounterClockwise;
        DepthBias = depthBias;
        DepthBiasClamp = depthBiasClamp;
        SlopeScaledDepthBias = slopeScaledDepthBias;
        DepthClipEnable = depthClipEnable;
        MultisampleEnable = multisampleEnable;
        AntialiasedLineEnable = antialiasedLineEnable;
        ForcedSampleCount = forcedSampleCount;
        ConservativeRaster = conservativeRaster;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO
{
    CD3DX12_RESOURCE_ALLOCATION_INFO() = default;
    explicit CD3DX12_RESOURCE_ALLOCATION_INFO( const D3D12_RESOURCE_ALLOCATION_INFO& o ) :
        D3D12_RESOURCE_ALLOCATION_INFO( o )
    {}
    CD3DX12_RESOURCE_ALLOCATION_INFO(
        UINT64 size,
        UINT64 alignment )
    {
        SizeInBytes = size;
        Alignment = alignment;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES
{
    CD3DX12_HEAP_PROPERTIES() = default;
    explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES &o) :
        D3D12_HEAP_PROPERTIES(o)
    {}
    CD3DX12_HEAP_PROPERTIES( 
        D3D12_CPU_PAGE_PROPERTY cpuPageProperty, 
        D3D12_MEMORY_POOL memoryPoolPreference,
        UINT creationNodeMask = 1, 
        UINT nodeMask = 1 )
    {
        Type = D3D12_HEAP_TYPE_CUSTOM;
        CPUPageProperty = cpuPageProperty;
        MemoryPoolPreference = memoryPoolPreference;
        CreationNodeMask = creationNodeMask;
        VisibleNodeMask = nodeMask;
    }
    explicit CD3DX12_HEAP_PROPERTIES( 
        D3D12_HEAP_TYPE type, 
        UINT creationNodeMask = 1, 
        UINT nodeMask = 1 )
    {
        Type = type;
        CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
        MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
        CreationNodeMask = creationNodeMask;
        VisibleNodeMask = nodeMask;
    }
    bool IsCPUAccessible() const
    {
        return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM &&
            (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK));
    }
};
inline bool operator==( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
{
    return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty && 
        l.MemoryPoolPreference == r.MemoryPoolPreference &&
        l.CreationNodeMask == r.CreationNodeMask &&
        l.VisibleNodeMask == r.VisibleNodeMask;
}
inline bool operator!=( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
{
    CD3DX12_HEAP_DESC() = default;
    explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) :
        D3D12_HEAP_DESC(o)
    {}
    CD3DX12_HEAP_DESC( 
        UINT64 size, 
        D3D12_HEAP_PROPERTIES properties, 
        UINT64 alignment = 0, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = size;
        Properties = properties;
        Alignment = alignment;
        Flags = flags;
    }
    CD3DX12_HEAP_DESC( 
        UINT64 size, 
        D3D12_HEAP_TYPE type, 
        UINT64 alignment = 0, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = size;
        Properties = CD3DX12_HEAP_PROPERTIES( type );
        Alignment = alignment;
        Flags = flags;
    }
    CD3DX12_HEAP_DESC( 
        UINT64 size, 
        D3D12_CPU_PAGE_PROPERTY cpuPageProperty, 
        D3D12_MEMORY_POOL memoryPoolPreference, 
        UINT64 alignment = 0, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = size;
        Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
        Alignment = alignment;
        Flags = flags;
    }
    CD3DX12_HEAP_DESC( 
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_HEAP_PROPERTIES properties, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = resAllocInfo.SizeInBytes;
        Properties = properties;
        Alignment = resAllocInfo.Alignment;
        Flags = flags;
    }
    CD3DX12_HEAP_DESC( 
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_HEAP_TYPE type, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = resAllocInfo.SizeInBytes;
        Properties = CD3DX12_HEAP_PROPERTIES( type );
        Alignment = resAllocInfo.Alignment;
        Flags = flags;
    }
    CD3DX12_HEAP_DESC( 
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_CPU_PAGE_PROPERTY cpuPageProperty, 
        D3D12_MEMORY_POOL memoryPoolPreference, 
        D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
    {
        SizeInBytes = resAllocInfo.SizeInBytes;
        Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
        Alignment = resAllocInfo.Alignment;
        Flags = flags;
    }
    bool IsCPUAccessible() const
    { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
};
inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
{
    return l.SizeInBytes == r.SizeInBytes &&
        l.Properties == r.Properties && 
        l.Alignment == r.Alignment &&
        l.Flags == r.Flags;
}
inline bool operator!=( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
{
    CD3DX12_CLEAR_VALUE() = default;
    explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) :
        D3D12_CLEAR_VALUE(o)
    {}
    CD3DX12_CLEAR_VALUE( 
        DXGI_FORMAT format, 
        const FLOAT color[4] )
    {
        Format = format;
        memcpy( Color, color, sizeof( Color ) );
    }
    CD3DX12_CLEAR_VALUE( 
        DXGI_FORMAT format, 
        FLOAT depth,
        UINT8 stencil )
    {
        Format = format;
        /* Use memcpy to preserve NAN values */
        memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) );
        DepthStencil.Stencil = stencil;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_RANGE : public D3D12_RANGE
{
    CD3DX12_RANGE() = default;
    explicit CD3DX12_RANGE(const D3D12_RANGE &o) :
        D3D12_RANGE(o)
    {}
    CD3DX12_RANGE( 
        SIZE_T begin, 
        SIZE_T end )
    {
        Begin = begin;
        End = end;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_RANGE_UINT64 : public D3D12_RANGE_UINT64
{
    CD3DX12_RANGE_UINT64() = default;
    explicit CD3DX12_RANGE_UINT64(const D3D12_RANGE_UINT64 &o) :
        D3D12_RANGE_UINT64(o)
    {}
    CD3DX12_RANGE_UINT64( 
        UINT64 begin, 
        UINT64 end )
    {
        Begin = begin;
        End = end;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_SUBRESOURCE_RANGE_UINT64 : public D3D12_SUBRESOURCE_RANGE_UINT64
{
    CD3DX12_SUBRESOURCE_RANGE_UINT64() = default;
    explicit CD3DX12_SUBRESOURCE_RANGE_UINT64(const D3D12_SUBRESOURCE_RANGE_UINT64 &o) :
        D3D12_SUBRESOURCE_RANGE_UINT64(o)
    {}
    CD3DX12_SUBRESOURCE_RANGE_UINT64( 
        UINT subresource,
        const D3D12_RANGE_UINT64& range )
    {
        Subresource = subresource;
        Range = range;
    }
    CD3DX12_SUBRESOURCE_RANGE_UINT64( 
        UINT subresource,
        UINT64 begin, 
        UINT64 end )
    {
        Subresource = subresource;
        Range.Begin = begin;
        Range.End = end;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_SHADER_BYTECODE : public D3D12_SHADER_BYTECODE
{
    CD3DX12_SHADER_BYTECODE() = default;
    explicit CD3DX12_SHADER_BYTECODE(const D3D12_SHADER_BYTECODE &o) :
        D3D12_SHADER_BYTECODE(o)
    {}
    CD3DX12_SHADER_BYTECODE(
        _In_ ID3DBlob* pShaderBlob )
    {
        pShaderBytecode = pShaderBlob->GetBufferPointer();
        BytecodeLength = pShaderBlob->GetBufferSize();
    }
    CD3DX12_SHADER_BYTECODE(
        const void* _pShaderBytecode,
        SIZE_T bytecodeLength )
    {
        pShaderBytecode = _pShaderBytecode;
        BytecodeLength = bytecodeLength;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE
{
    CD3DX12_TILED_RESOURCE_COORDINATE() = default;
    explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE &o) :
        D3D12_TILED_RESOURCE_COORDINATE(o)
    {}
    CD3DX12_TILED_RESOURCE_COORDINATE( 
        UINT x, 
        UINT y, 
        UINT z, 
        UINT subresource ) 
    {
        X = x;
        Y = y;
        Z = z;
        Subresource = subresource;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE
{
    CD3DX12_TILE_REGION_SIZE() = default;
    explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE &o) :
        D3D12_TILE_REGION_SIZE(o)
    {}
    CD3DX12_TILE_REGION_SIZE( 
        UINT numTiles, 
        BOOL useBox, 
        UINT width, 
        UINT16 height, 
        UINT16 depth ) 
    {
        NumTiles = numTiles;
        UseBox = useBox;
        Width = width;
        Height = height;
        Depth = depth;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING
{
    CD3DX12_SUBRESOURCE_TILING() = default;
    explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING &o) :
        D3D12_SUBRESOURCE_TILING(o)
    {}
    CD3DX12_SUBRESOURCE_TILING( 
        UINT widthInTiles, 
        UINT16 heightInTiles, 
        UINT16 depthInTiles, 
        UINT startTileIndexInOverallResource ) 
    {
        WidthInTiles = widthInTiles;
        HeightInTiles = heightInTiles;
        DepthInTiles = depthInTiles;
        StartTileIndexInOverallResource = startTileIndexInOverallResource;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE
{
    CD3DX12_TILE_SHAPE() = default;
    explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE &o) :
        D3D12_TILE_SHAPE(o)
    {}
    CD3DX12_TILE_SHAPE( 
        UINT widthInTexels, 
        UINT heightInTexels, 
        UINT depthInTexels ) 
    {
        WidthInTexels = widthInTexels;
        HeightInTexels = heightInTexels;
        DepthInTexels = depthInTexels;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
{
    CD3DX12_RESOURCE_BARRIER() = default;
    explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) :
        D3D12_RESOURCE_BARRIER(o)
    {}
    static inline CD3DX12_RESOURCE_BARRIER Transition(
        _In_ ID3D12Resource* pResource,
        D3D12_RESOURCE_STATES stateBefore,
        D3D12_RESOURCE_STATES stateAfter,
        UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,
        D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE)
    {
        CD3DX12_RESOURCE_BARRIER result = {};
        D3D12_RESOURCE_BARRIER &barrier = result;
        result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
        result.Flags = flags;
        barrier.Transition.pResource = pResource;
        barrier.Transition.StateBefore = stateBefore;
        barrier.Transition.StateAfter = stateAfter;
        barrier.Transition.Subresource = subresource;
        return result;
    }
    static inline CD3DX12_RESOURCE_BARRIER Aliasing(
        _In_ ID3D12Resource* pResourceBefore,
        _In_ ID3D12Resource* pResourceAfter)
    {
        CD3DX12_RESOURCE_BARRIER result = {};
        D3D12_RESOURCE_BARRIER &barrier = result;
        result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING;
        barrier.Aliasing.pResourceBefore = pResourceBefore;
        barrier.Aliasing.pResourceAfter = pResourceAfter;
        return result;
    }
    static inline CD3DX12_RESOURCE_BARRIER UAV(
        _In_ ID3D12Resource* pResource)
    {
        CD3DX12_RESOURCE_BARRIER result = {};
        D3D12_RESOURCE_BARRIER &barrier = result;
        result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
        barrier.UAV.pResource = pResource;
        return result;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO
{
    CD3DX12_PACKED_MIP_INFO() = default;
    explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO &o) :
        D3D12_PACKED_MIP_INFO(o)
    {}
    CD3DX12_PACKED_MIP_INFO( 
        UINT8 numStandardMips, 
        UINT8 numPackedMips, 
        UINT numTilesForPackedMips, 
        UINT startTileIndexInOverallResource ) 
    {
        NumStandardMips = numStandardMips;
        NumPackedMips = numPackedMips;
        NumTilesForPackedMips = numTilesForPackedMips;
        StartTileIndexInOverallResource = startTileIndexInOverallResource;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
{
    CD3DX12_SUBRESOURCE_FOOTPRINT() = default;
    explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT &o) :
        D3D12_SUBRESOURCE_FOOTPRINT(o)
    {}
    CD3DX12_SUBRESOURCE_FOOTPRINT( 
        DXGI_FORMAT format, 
        UINT width, 
        UINT height, 
        UINT depth, 
        UINT rowPitch ) 
    {
        Format = format;
        Width = width;
        Height = height;
        Depth = depth;
        RowPitch = rowPitch;
    }
    explicit CD3DX12_SUBRESOURCE_FOOTPRINT( 
        const D3D12_RESOURCE_DESC& resDesc, 
        UINT rowPitch ) 
    {
        Format = resDesc.Format;
        Width = UINT( resDesc.Width );
        Height = resDesc.Height;
        Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1);
        RowPitch = rowPitch;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION
{ 
    CD3DX12_TEXTURE_COPY_LOCATION() = default;
    explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION &o) :
        D3D12_TEXTURE_COPY_LOCATION(o)
    {}
    CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes)
    {
        pResource = pRes;
        Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
        PlacedFootprint = {};
    }
    CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint)
    {
        pResource = pRes;
        Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
        PlacedFootprint = Footprint;
    }
    CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub)
    {
        pResource = pRes;
        Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
        SubresourceIndex = Sub;
    }
}; 

//------------------------------------------------------------------------------------------------
struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
{
    CD3DX12_DESCRIPTOR_RANGE() = default;
    explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) :
        D3D12_DESCRIPTOR_RANGE(o)
    {}
    CD3DX12_DESCRIPTOR_RANGE(
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
    }
    
    inline void Init(
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
    }
    
    static inline void Init(
        _Out_ D3D12_DESCRIPTOR_RANGE &range,
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        range.RangeType = rangeType;
        range.NumDescriptors = numDescriptors;
        range.BaseShaderRegister = baseShaderRegister;
        range.RegisterSpace = registerSpace;
        range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE
{
    CD3DX12_ROOT_DESCRIPTOR_TABLE() = default;
    explicit CD3DX12_ROOT_DESCRIPTOR_TABLE(const D3D12_ROOT_DESCRIPTOR_TABLE &o) :
        D3D12_ROOT_DESCRIPTOR_TABLE(o)
    {}
    CD3DX12_ROOT_DESCRIPTOR_TABLE(
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
    {
        Init(numDescriptorRanges, _pDescriptorRanges);
    }
    
    inline void Init(
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
    {
        Init(*this, numDescriptorRanges, _pDescriptorRanges);
    }
    
    static inline void Init(
        _Out_ D3D12_ROOT_DESCRIPTOR_TABLE &rootDescriptorTable,
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
    {
        rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges;
        rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS
{
    CD3DX12_ROOT_CONSTANTS() = default;
    explicit CD3DX12_ROOT_CONSTANTS(const D3D12_ROOT_CONSTANTS &o) :
        D3D12_ROOT_CONSTANTS(o)
    {}
    CD3DX12_ROOT_CONSTANTS(
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0)
    {
        Init(num32BitValues, shaderRegister, registerSpace);
    }
    
    inline void Init(
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0)
    {
        Init(*this, num32BitValues, shaderRegister, registerSpace);
    }
    
    static inline void Init(
        _Out_ D3D12_ROOT_CONSTANTS &rootConstants,
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0)
    {
        rootConstants.Num32BitValues = num32BitValues;
        rootConstants.ShaderRegister = shaderRegister;
        rootConstants.RegisterSpace = registerSpace;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR
{
    CD3DX12_ROOT_DESCRIPTOR() = default;
    explicit CD3DX12_ROOT_DESCRIPTOR(const D3D12_ROOT_DESCRIPTOR &o) :
        D3D12_ROOT_DESCRIPTOR(o)
    {}
    CD3DX12_ROOT_DESCRIPTOR(
        UINT shaderRegister,
        UINT registerSpace = 0)
    {
        Init(shaderRegister, registerSpace);
    }
    
    inline void Init(
        UINT shaderRegister,
        UINT registerSpace = 0)
    {
        Init(*this, shaderRegister, registerSpace);
    }
    
    static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0)
    {
        table.ShaderRegister = shaderRegister;
        table.RegisterSpace = registerSpace;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER
{
    CD3DX12_ROOT_PARAMETER() = default;
    explicit CD3DX12_ROOT_PARAMETER(const D3D12_ROOT_PARAMETER &o) :
        D3D12_ROOT_PARAMETER(o)
    {}
    
    static inline void InitAsDescriptorTable(
        _Out_ D3D12_ROOT_PARAMETER &rootParam,
        UINT numDescriptorRanges,
        _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR_TABLE::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges);
    }

    static inline void InitAsConstants(
        _Out_ D3D12_ROOT_PARAMETER &rootParam,
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace);
    }

    static inline void InitAsConstantBufferView(
        _Out_ D3D12_ROOT_PARAMETER &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
    }

    static inline void InitAsShaderResourceView(
        _Out_ D3D12_ROOT_PARAMETER &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
    }

    static inline void InitAsUnorderedAccessView(
        _Out_ D3D12_ROOT_PARAMETER &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
    }
    
    inline void InitAsDescriptorTable(
        UINT numDescriptorRanges,
        _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
    }
    
    inline void InitAsConstants(
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
    }

    inline void InitAsConstantBufferView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility);
    }

    inline void InitAsShaderResourceView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility);
    }

    inline void InitAsUnorderedAccessView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, visibility);
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC
{
    CD3DX12_STATIC_SAMPLER_DESC() = default;
    explicit CD3DX12_STATIC_SAMPLER_DESC(const D3D12_STATIC_SAMPLER_DESC &o) :
        D3D12_STATIC_SAMPLER_DESC(o)
    {}
    CD3DX12_STATIC_SAMPLER_DESC(
         UINT shaderRegister,
         D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
         D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         FLOAT mipLODBias = 0,
         UINT maxAnisotropy = 16,
         D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
         D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
         FLOAT minLOD = 0.f,
         FLOAT maxLOD = D3D12_FLOAT32_MAX,
         D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, 
         UINT registerSpace = 0)
    {
        Init(
            shaderRegister,
            filter,
            addressU,
            addressV,
            addressW,
            mipLODBias,
            maxAnisotropy,
            comparisonFunc,
            borderColor,
            minLOD,
            maxLOD,
            shaderVisibility,
            registerSpace);
    }
    
    static inline void Init(
        _Out_ D3D12_STATIC_SAMPLER_DESC &samplerDesc,
         UINT shaderRegister,
         D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
         D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         FLOAT mipLODBias = 0,
         UINT maxAnisotropy = 16,
         D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
         D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
         FLOAT minLOD = 0.f,
         FLOAT maxLOD = D3D12_FLOAT32_MAX,
         D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, 
         UINT registerSpace = 0)
    {
        samplerDesc.ShaderRegister = shaderRegister;
        samplerDesc.Filter = filter;
        samplerDesc.AddressU = addressU;
        samplerDesc.AddressV = addressV;
        samplerDesc.AddressW = addressW;
        samplerDesc.MipLODBias = mipLODBias;
        samplerDesc.MaxAnisotropy = maxAnisotropy;
        samplerDesc.ComparisonFunc = comparisonFunc;
        samplerDesc.BorderColor = borderColor;
        samplerDesc.MinLOD = minLOD;
        samplerDesc.MaxLOD = maxLOD;
        samplerDesc.ShaderVisibility = shaderVisibility;
        samplerDesc.RegisterSpace = registerSpace;
    }
    inline void Init(
         UINT shaderRegister,
         D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
         D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
         FLOAT mipLODBias = 0,
         UINT maxAnisotropy = 16,
         D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
         D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
         FLOAT minLOD = 0.f,
         FLOAT maxLOD = D3D12_FLOAT32_MAX,
         D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, 
         UINT registerSpace = 0)
    {
        Init(
            *this,
            shaderRegister,
            filter,
            addressU,
            addressV,
            addressW,
            mipLODBias,
            maxAnisotropy,
            comparisonFunc,
            borderColor,
            minLOD,
            maxLOD,
            shaderVisibility,
            registerSpace);
    }
    
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC
{
    CD3DX12_ROOT_SIGNATURE_DESC() = default;
    explicit CD3DX12_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) :
        D3D12_ROOT_SIGNATURE_DESC(o)
    {}
    CD3DX12_ROOT_SIGNATURE_DESC(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }
    CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
    {
        Init(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE);
    }
    
    inline void Init(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }

    static inline void Init(
        _Out_ D3D12_ROOT_SIGNATURE_DESC &desc,
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        desc.NumParameters = numParameters;
        desc.pParameters = _pParameters;
        desc.NumStaticSamplers = numStaticSamplers;
        desc.pStaticSamplers = _pStaticSamplers;
        desc.Flags = flags;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_DESCRIPTOR_RANGE1 : public D3D12_DESCRIPTOR_RANGE1
{
    CD3DX12_DESCRIPTOR_RANGE1() = default;
    explicit CD3DX12_DESCRIPTOR_RANGE1(const D3D12_DESCRIPTOR_RANGE1 &o) :
        D3D12_DESCRIPTOR_RANGE1(o)
    {}
    CD3DX12_DESCRIPTOR_RANGE1(
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart);
    }
    
    inline void Init(
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart);
    }
    
    static inline void Init(
        _Out_ D3D12_DESCRIPTOR_RANGE1 &range,
        D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
        UINT numDescriptors,
        UINT baseShaderRegister,
        UINT registerSpace = 0,
        D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE,
        UINT offsetInDescriptorsFromTableStart =
        D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
    {
        range.RangeType = rangeType;
        range.NumDescriptors = numDescriptors;
        range.BaseShaderRegister = baseShaderRegister;
        range.RegisterSpace = registerSpace;
        range.Flags = flags;
        range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_DESCRIPTOR_TABLE1 : public D3D12_ROOT_DESCRIPTOR_TABLE1
{
    CD3DX12_ROOT_DESCRIPTOR_TABLE1() = default;
    explicit CD3DX12_ROOT_DESCRIPTOR_TABLE1(const D3D12_ROOT_DESCRIPTOR_TABLE1 &o) :
        D3D12_ROOT_DESCRIPTOR_TABLE1(o)
    {}
    CD3DX12_ROOT_DESCRIPTOR_TABLE1(
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges)
    {
        Init(numDescriptorRanges, _pDescriptorRanges);
    }
    
    inline void Init(
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges)
    {
        Init(*this, numDescriptorRanges, _pDescriptorRanges);
    }
    
    static inline void Init(
        _Out_ D3D12_ROOT_DESCRIPTOR_TABLE1 &rootDescriptorTable,
        UINT numDescriptorRanges,
        _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges)
    {
        rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges;
        rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_DESCRIPTOR1 : public D3D12_ROOT_DESCRIPTOR1
{
    CD3DX12_ROOT_DESCRIPTOR1() = default;
    explicit CD3DX12_ROOT_DESCRIPTOR1(const D3D12_ROOT_DESCRIPTOR1 &o) :
        D3D12_ROOT_DESCRIPTOR1(o)
    {}
    CD3DX12_ROOT_DESCRIPTOR1(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE)
    {
        Init(shaderRegister, registerSpace, flags);
    }
    
    inline void Init(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE)
    {
        Init(*this, shaderRegister, registerSpace, flags);
    }
    
    static inline void Init(
        _Out_ D3D12_ROOT_DESCRIPTOR1 &table, 
        UINT shaderRegister, 
        UINT registerSpace = 0, 
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE)
    {
        table.ShaderRegister = shaderRegister;
        table.RegisterSpace = registerSpace;
        table.Flags = flags;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_ROOT_PARAMETER1 : public D3D12_ROOT_PARAMETER1
{
    CD3DX12_ROOT_PARAMETER1() = default;
    explicit CD3DX12_ROOT_PARAMETER1(const D3D12_ROOT_PARAMETER1 &o) :
        D3D12_ROOT_PARAMETER1(o)
    {}
    
    static inline void InitAsDescriptorTable(
        _Out_ D3D12_ROOT_PARAMETER1 &rootParam,
        UINT numDescriptorRanges,
        _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR_TABLE1::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges);
    }

    static inline void InitAsConstants(
        _Out_ D3D12_ROOT_PARAMETER1 &rootParam,
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace);
    }

    static inline void InitAsConstantBufferView(
        _Out_ D3D12_ROOT_PARAMETER1 &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags);
    }

    static inline void InitAsShaderResourceView(
        _Out_ D3D12_ROOT_PARAMETER1 &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags);
    }

    static inline void InitAsUnorderedAccessView(
        _Out_ D3D12_ROOT_PARAMETER1 &rootParam,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
        rootParam.ShaderVisibility = visibility;
        CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags);
    }
    
    inline void InitAsDescriptorTable(
        UINT numDescriptorRanges,
        _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
    }
    
    inline void InitAsConstants(
        UINT num32BitValues,
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
    }

    inline void InitAsConstantBufferView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsConstantBufferView(*this, shaderRegister, registerSpace, flags, visibility);
    }

    inline void InitAsShaderResourceView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsShaderResourceView(*this, shaderRegister, registerSpace, flags, visibility);
    }

    inline void InitAsUnorderedAccessView(
        UINT shaderRegister,
        UINT registerSpace = 0,
        D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE,
        D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
    {
        InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, flags, visibility);
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNATURE_DESC
{
    CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC() = default;
    explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC &o) :
        D3D12_VERSIONED_ROOT_SIGNATURE_DESC(o)
    {}
    explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o)
    {
        Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
        Desc_1_0 = o;
    }
    explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC1 &o)
    {
        Version = D3D_ROOT_SIGNATURE_VERSION_1_1;
        Desc_1_1 = o;
    }
    CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init_1_0(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }
    CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init_1_1(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }
    CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
    {
        Init_1_1(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE);
    }
    
    inline void Init_1_0(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init_1_0(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }

    static inline void Init_1_0(
        _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc,
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
        desc.Desc_1_0.NumParameters = numParameters;
        desc.Desc_1_0.pParameters = _pParameters;
        desc.Desc_1_0.NumStaticSamplers = numStaticSamplers;
        desc.Desc_1_0.pStaticSamplers = _pStaticSamplers;
        desc.Desc_1_0.Flags = flags;
    }

    inline void Init_1_1(
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        Init_1_1(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
    }

    static inline void Init_1_1(
        _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc,
        UINT numParameters,
        _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters,
        UINT numStaticSamplers = 0,
        _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr,
        D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
    {
        desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_1;
        desc.Desc_1_1.NumParameters = numParameters;
        desc.Desc_1_1.pParameters = _pParameters;
        desc.Desc_1_1.NumStaticSamplers = numStaticSamplers;
        desc.Desc_1_1.pStaticSamplers = _pStaticSamplers;
        desc.Desc_1_1.Flags = flags;
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE
{
    CD3DX12_CPU_DESCRIPTOR_HANDLE() = default;
    explicit CD3DX12_CPU_DESCRIPTOR_HANDLE(const D3D12_CPU_DESCRIPTOR_HANDLE &o) :
        D3D12_CPU_DESCRIPTOR_HANDLE(o)
    {}
    CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
    CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
    {
        InitOffsetted(other, offsetScaledByIncrementSize);
    }
    CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
    }
    CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
    { 
        ptr = SIZE_T(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
        return *this;
    }
    CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) 
    { 
        ptr = SIZE_T(INT64(ptr) + INT64(offsetScaledByIncrementSize));
        return *this;
    }
    bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const
    {
        return (ptr == other.ptr);
    }
    bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const
    {
        return (ptr != other.ptr);
    }
    CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other)
    {
        ptr = other.ptr;
        return *this;
    }

    inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
    {
        InitOffsetted(*this, base, offsetScaledByIncrementSize);
    }
    
    inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
    }
    
    static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
    {
        handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetScaledByIncrementSize));
    }
    
    static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
    }
};

//------------------------------------------------------------------------------------------------
struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
{
    CD3DX12_GPU_DESCRIPTOR_HANDLE() = default;
    explicit CD3DX12_GPU_DESCRIPTOR_HANDLE(const D3D12_GPU_DESCRIPTOR_HANDLE &o) :
        D3D12_GPU_DESCRIPTOR_HANDLE(o)
    {}
    CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
    CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
    {
        InitOffsetted(other, offsetScaledByIncrementSize);
    }
    CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
    }
    CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
    { 
        ptr = UINT64(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
        return *this;
    }
    CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) 
    { 
        ptr = UINT64(INT64(ptr) + INT64(offsetScaledByIncrementSize));
        return *this;
    }
    inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const
    {
        return (ptr == other.ptr);
    }
    inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const
    {
        return (ptr != other.ptr);
    }
    CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other)
    {
        ptr = other.ptr;
        return *this;
    }

    inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
    {
        InitOffsetted(*this, base, offsetScaledByIncrementSize);
    }
    
    inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
    }
    
    static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
    {
        handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetScaledByIncrementSize));
    }
    
    static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
    {
        handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
    }
};

//------------------------------------------------------------------------------------------------
inline UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize )
{ 
    return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize; 
}

//------------------------------------------------------------------------------------------------
template <typename T, typename U, typename V>
inline void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT ArraySize, _Out_ T& MipSlice, _Out_ U& ArraySlice, _Out_ V& PlaneSlice )
{
    MipSlice = static_cast<T>(Subresource % MipLevels);
    ArraySlice = static_cast<U>((Subresource / MipLevels) % ArraySize);
    PlaneSlice = static_cast<V>(Subresource / (MipLevels * ArraySize));
}

//------------------------------------------------------------------------------------------------
inline UINT8 D3D12GetFormatPlaneCount(
    _In_ ID3D12Device* pDevice,
    DXGI_FORMAT Format
    )
{
    D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = { Format, 0 };
    if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo))))
    {
        return 0;
    }
    return formatInfo.PlaneCount;
}

//------------------------------------------------------------------------------------------------
struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
{
    CD3DX12_RESOURCE_DESC() = default;
    explicit CD3DX12_RESOURCE_DESC( const D3D12_RESOURCE_DESC& o ) :
        D3D12_RESOURCE_DESC( o )
    {}
    CD3DX12_RESOURCE_DESC( 
        D3D12_RESOURCE_DIMENSION dimension,
        UINT64 alignment,
        UINT64 width,
        UINT height,
        UINT16 depthOrArraySize,
        UINT16 mipLevels,
        DXGI_FORMAT format,
        UINT sampleCount,
        UINT sampleQuality,
        D3D12_TEXTURE_LAYOUT layout,
        D3D12_RESOURCE_FLAGS flags )
    {
        Dimension = dimension;
        Alignment = alignment;
        Width = width;
        Height = height;
        DepthOrArraySize = depthOrArraySize;
        MipLevels = mipLevels;
        Format = format;
        SampleDesc.Count = sampleCount;
        SampleDesc.Quality = sampleQuality;
        Layout = layout;
        Flags = flags;
    }
    static inline CD3DX12_RESOURCE_DESC Buffer( 
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE )
    {
        return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, 
            1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
    }
    static inline CD3DX12_RESOURCE_DESC Buffer( 
        UINT64 width,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, 
            DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
    }
    static inline CD3DX12_RESOURCE_DESC Tex1D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT16 arraySize = 1,
        UINT16 mipLevels = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, 
            mipLevels, format, 1, 0, layout, flags );
    }
    static inline CD3DX12_RESOURCE_DESC Tex2D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT height,
        UINT16 arraySize = 1,
        UINT16 mipLevels = 0,
        UINT sampleCount = 1,
        UINT sampleQuality = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, 
            mipLevels, format, sampleCount, sampleQuality, layout, flags );
    }
    static inline CD3DX12_RESOURCE_DESC Tex3D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT height,
        UINT16 depth,
        UINT16 mipLevels = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, 
            mipLevels, format, 1, 0, layout, flags );
    }
    inline UINT16 Depth() const
    { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
    inline UINT16 ArraySize() const
    { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
    inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
    { return D3D12GetFormatPlaneCount(pDevice, Format); }
    inline UINT Subresources(_In_ ID3D12Device* pDevice) const
    { return MipLevels * ArraySize() * PlaneCount(pDevice); }
    inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)
    { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
};
inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
{
    return l.Dimension == r.Dimension &&
        l.Alignment == r.Alignment &&
        l.Width == r.Width &&
        l.Height == r.Height &&
        l.DepthOrArraySize == r.DepthOrArraySize &&
        l.MipLevels == r.MipLevels &&
        l.Format == r.Format &&
        l.SampleDesc.Count == r.SampleDesc.Count &&
        l.SampleDesc.Quality == r.SampleDesc.Quality &&
        l.Layout == r.Layout &&
        l.Flags == r.Flags;
}
inline bool operator!=( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
{
    CD3DX12_RESOURCE_DESC1() = default;
    explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC1& o ) :
        D3D12_RESOURCE_DESC1( o )
    {}
    CD3DX12_RESOURCE_DESC1( 
        D3D12_RESOURCE_DIMENSION dimension,
        UINT64 alignment,
        UINT64 width,
        UINT height,
        UINT16 depthOrArraySize,
        UINT16 mipLevels,
        DXGI_FORMAT format,
        UINT sampleCount,
        UINT sampleQuality,
        D3D12_TEXTURE_LAYOUT layout,
        D3D12_RESOURCE_FLAGS flags,
        UINT samplerFeedbackMipRegionWidth = 0,
        UINT samplerFeedbackMipRegionHeight = 0,
        UINT samplerFeedbackMipRegionDepth = 0)
    {
        Dimension = dimension;
        Alignment = alignment;
        Width = width;
        Height = height;
        DepthOrArraySize = depthOrArraySize;
        MipLevels = mipLevels;
        Format = format;
        SampleDesc.Count = sampleCount;
        SampleDesc.Quality = sampleQuality;
        Layout = layout;
        Flags = flags;
        SamplerFeedbackMipRegion.Width = samplerFeedbackMipRegionWidth;
        SamplerFeedbackMipRegion.Height = samplerFeedbackMipRegionHeight;
        SamplerFeedbackMipRegion.Depth = samplerFeedbackMipRegionDepth;
    }
    static inline CD3DX12_RESOURCE_DESC1 Buffer( 
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE )
    {
        return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, 
            1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 );
    }
    static inline CD3DX12_RESOURCE_DESC1 Buffer( 
        UINT64 width,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, 
            DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 );
    }
    static inline CD3DX12_RESOURCE_DESC1 Tex1D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT16 arraySize = 1,
        UINT16 mipLevels = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, 
            mipLevels, format, 1, 0, layout, flags, 0, 0, 0 );
    }
    static inline CD3DX12_RESOURCE_DESC1 Tex2D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT height,
        UINT16 arraySize = 1,
        UINT16 mipLevels = 0,
        UINT sampleCount = 1,
        UINT sampleQuality = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0,
        UINT samplerFeedbackMipRegionWidth = 0,
        UINT samplerFeedbackMipRegionHeight = 0,
        UINT samplerFeedbackMipRegionDepth = 0)
    {
        return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, 
            mipLevels, format, sampleCount, sampleQuality, layout, flags, samplerFeedbackMipRegionWidth,
            samplerFeedbackMipRegionHeight, samplerFeedbackMipRegionDepth );
    }
    static inline CD3DX12_RESOURCE_DESC1 Tex3D( 
        DXGI_FORMAT format,
        UINT64 width,
        UINT height,
        UINT16 depth,
        UINT16 mipLevels = 0,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
        UINT64 alignment = 0 )
    {
        return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, 
            mipLevels, format, 1, 0, layout, flags, 0, 0, 0 );
    }
    inline UINT16 Depth() const
    { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
    inline UINT16 ArraySize() const
    { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
    inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
    { return D3D12GetFormatPlaneCount(pDevice, Format); }
    inline UINT Subresources(_In_ ID3D12Device* pDevice) const
    { return MipLevels * ArraySize() * PlaneCount(pDevice); }
    inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)
    { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
};
inline bool operator==( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r )
{
    return l.Dimension == r.Dimension &&
        l.Alignment == r.Alignment &&
        l.Width == r.Width &&
        l.Height == r.Height &&
        l.DepthOrArraySize == r.DepthOrArraySize &&
        l.MipLevels == r.MipLevels &&
        l.Format == r.Format &&
        l.SampleDesc.Count == r.SampleDesc.Count &&
        l.SampleDesc.Quality == r.SampleDesc.Quality &&
        l.Layout == r.Layout &&
        l.Flags == r.Flags &&
        l.SamplerFeedbackMipRegion.Width == r.SamplerFeedbackMipRegion.Width &&
        l.SamplerFeedbackMipRegion.Height == r.SamplerFeedbackMipRegion.Height &&
        l.SamplerFeedbackMipRegion.Depth == r.SamplerFeedbackMipRegion.Depth;
}
inline bool operator!=( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r )
{ return !( l == r ); }

//------------------------------------------------------------------------------------------------
struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC
{
    CD3DX12_VIEW_INSTANCING_DESC() = default;
    explicit CD3DX12_VIEW_INSTANCING_DESC( const D3D12_VIEW_INSTANCING_DESC& o ) :
        D3D12_VIEW_INSTANCING_DESC( o )
    {}
    explicit CD3DX12_VIEW_INSTANCING_DESC( CD3DX12_DEFAULT )
    {
        ViewInstanceCount = 0;
        pViewInstanceLocations = nullptr;
        Flags = D3D12_VIEW_INSTANCING_FLAG_NONE;
    }
    explicit CD3DX12_VIEW_INSTANCING_DESC( 
        UINT InViewInstanceCount,
        const D3D12_VIEW_INSTANCE_LOCATION* InViewInstanceLocations,
        D3D12_VIEW_INSTANCING_FLAGS InFlags)
    {
        ViewInstanceCount = InViewInstanceCount;
        pViewInstanceLocations = InViewInstanceLocations;
        Flags = InFlags;
    }
};

//------------------------------------------------------------------------------------------------
// Row-by-row memcpy
inline void MemcpySubresource(
    _In_ const D3D12_MEMCPY_DEST* pDest,
    _In_ const D3D12_SUBRESOURCE_DATA* pSrc,
    SIZE_T RowSizeInBytes,
    UINT NumRows,
    UINT NumSlices)
{
    for (UINT z = 0; z < NumSlices; ++z)
    {
        auto pDestSlice = reinterpret_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
        auto pSrcSlice = reinterpret_cast<const BYTE*>(pSrc->pData) + pSrc->SlicePitch * LONG_PTR(z);
        for (UINT y = 0; y < NumRows; ++y)
        {
            memcpy(pDestSlice + pDest->RowPitch * y,
                   pSrcSlice + pSrc->RowPitch * LONG_PTR(y),
                   RowSizeInBytes);
        }
    }
}

//------------------------------------------------------------------------------------------------
// Returns required size of a buffer to be used for data upload
inline UINT64 GetRequiredIntermediateSize(
    _In_ ID3D12Resource* pDestinationResource,
    _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
    _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources)
{
    auto Desc = pDestinationResource->GetDesc();
    UINT64 RequiredSize = 0;
    
    ID3D12Device* pDevice = nullptr;
    pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice));
    pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize);
    pDevice->Release();
    
    return RequiredSize;
}

//------------------------------------------------------------------------------------------------
// All arrays must be populated (e.g. by calling GetCopyableFootprints)
inline UINT64 UpdateSubresources(
    _In_ ID3D12GraphicsCommandList* pCmdList,
    _In_ ID3D12Resource* pDestinationResource,
    _In_ ID3D12Resource* pIntermediate,
    _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
    _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
    UINT64 RequiredSize,
    _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts,
    _In_reads_(NumSubresources) const UINT* pNumRows,
    _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes,
    _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData)
{
    // Minor validation
    auto IntermediateDesc = pIntermediate->GetDesc();
    auto DestinationDesc = pDestinationResource->GetDesc();
    if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER || 
        IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset || 
        RequiredSize > SIZE_T(-1) || 
        (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER && 
            (FirstSubresource != 0 || NumSubresources != 1)))
    {
        return 0;
    }
    
    BYTE* pData;
    HRESULT hr = pIntermediate->Map(0, nullptr, reinterpret_cast<void**>(&pData));
    if (FAILED(hr))
    {
        return 0;
    }
    
    for (UINT i = 0; i < NumSubresources; ++i)
    {
        if (pRowSizesInBytes[i] > SIZE_T(-1)) return 0;
        D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, SIZE_T(pLayouts[i].Footprint.RowPitch) * SIZE_T(pNumRows[i]) };
        MemcpySubresource(&DestData, &pSrcData[i], static_cast<SIZE_T>(pRowSizesInBytes[i]), pNumRows[i], pLayouts[i].Footprint.Depth);
    }
    pIntermediate->Unmap(0, nullptr);
    
    if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
    {
        pCmdList->CopyBufferRegion(
            pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width);
    }
    else
    {
        for (UINT i = 0; i < NumSubresources; ++i)
        {
            CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
            CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]);
            pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr);
        }
    }
    return RequiredSize;
}

//------------------------------------------------------------------------------------------------
// Heap-allocating UpdateSubresources implementation
inline UINT64 UpdateSubresources( 
    _In_ ID3D12GraphicsCommandList* pCmdList,
    _In_ ID3D12Resource* pDestinationResource,
    _In_ ID3D12Resource* pIntermediate,
    UINT64 IntermediateOffset,
    _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
    _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
    _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
{
    UINT64 RequiredSize = 0;
    UINT64 MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
    if (MemToAlloc > SIZE_MAX)
    {
       return 0;
    }
    void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast<SIZE_T>(MemToAlloc));
    if (pMem == nullptr)
    {
       return 0;
    }
    auto pLayouts = reinterpret_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
    UINT64* pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
    UINT* pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
    
    auto Desc = pDestinationResource->GetDesc();
    ID3D12Device* pDevice = nullptr;
    pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice));
    pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
    pDevice->Release();
    
    UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
    HeapFree(GetProcessHeap(), 0, pMem);
    return Result;
}

//------------------------------------------------------------------------------------------------
// Stack-allocating UpdateSubresources implementation
template <UINT MaxSubresources>
inline UINT64 UpdateSubresources( 
    _In_ ID3D12GraphicsCommandList* pCmdList,
    _In_ ID3D12Resource* pDestinationResource,
    _In_ ID3D12Resource* pIntermediate,
    UINT64 IntermediateOffset,
    _In_range_(0, MaxSubresources) UINT FirstSubresource,
    _In_range_(1, MaxSubresources - FirstSubresource) UINT NumSubresources,
    _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
{
    UINT64 RequiredSize = 0;
    D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
    UINT NumRows[MaxSubresources];
    UINT64 RowSizesInBytes[MaxSubresources];
    
    auto Desc = pDestinationResource->GetDesc();
    ID3D12Device* pDevice = nullptr;
    pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice));
    pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize);
    pDevice->Release();
    
    return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pSrcData);
}

//------------------------------------------------------------------------------------------------
inline bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout )
{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; }

//------------------------------------------------------------------------------------------------
template <typename t_CommandListType>
inline ID3D12CommandList * const * CommandListCast(t_CommandListType * const * pp)
{
    // This cast is useful for passing strongly typed command list pointers into
    // ExecuteCommandLists.
    // This cast is valid as long as the const-ness is respected. D3D12 APIs do
    // respect the const-ness of their arguments.
    return reinterpret_cast<ID3D12CommandList * const *>(pp);
}

//------------------------------------------------------------------------------------------------
// D3D12 exports a new method for serializing root signatures in the Windows 10 Anniversary Update.
// To help enable root signature 1.1 features when they are available and not require maintaining
// two code paths for building root signatures, this helper method reconstructs a 1.0 signature when
// 1.1 is not supported.
inline HRESULT D3DX12SerializeVersionedRootSignature(
    _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc,
    D3D_ROOT_SIGNATURE_VERSION MaxVersion,
    _Outptr_ ID3DBlob** ppBlob,
    _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob)
{
    if (ppErrorBlob != nullptr)
    {
        *ppErrorBlob = nullptr;
    }

    switch (MaxVersion)
    {
        case D3D_ROOT_SIGNATURE_VERSION_1_0:
            switch (pRootSignatureDesc->Version)
            {
                case D3D_ROOT_SIGNATURE_VERSION_1_0:
                    return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);

                case D3D_ROOT_SIGNATURE_VERSION_1_1:
                {
                    HRESULT hr = S_OK;
                    const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1;

                    const SIZE_T ParametersSize = sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters;
                    void* pParameters = (ParametersSize > 0) ? HeapAlloc(GetProcessHeap(), 0, ParametersSize) : nullptr;
                    if (ParametersSize > 0 && pParameters == nullptr)
                    {
                        hr = E_OUTOFMEMORY;
                    }
                    auto pParameters_1_0 = reinterpret_cast<D3D12_ROOT_PARAMETER*>(pParameters);

                    if (SUCCEEDED(hr))
                    {
                        for (UINT n = 0; n < desc_1_1.NumParameters; n++)
                        {
                            __analysis_assume(ParametersSize == sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters);
                            pParameters_1_0[n].ParameterType = desc_1_1.pParameters[n].ParameterType;
                            pParameters_1_0[n].ShaderVisibility = desc_1_1.pParameters[n].ShaderVisibility;

                            switch (desc_1_1.pParameters[n].ParameterType)
                            {
                            case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS:
                                pParameters_1_0[n].Constants.Num32BitValues = desc_1_1.pParameters[n].Constants.Num32BitValues;
                                pParameters_1_0[n].Constants.RegisterSpace = desc_1_1.pParameters[n].Constants.RegisterSpace;
                                pParameters_1_0[n].Constants.ShaderRegister = desc_1_1.pParameters[n].Constants.ShaderRegister;
                                break;

                            case D3D12_ROOT_PARAMETER_TYPE_CBV:
                            case D3D12_ROOT_PARAMETER_TYPE_SRV:
                            case D3D12_ROOT_PARAMETER_TYPE_UAV:
                                pParameters_1_0[n].Descriptor.RegisterSpace = desc_1_1.pParameters[n].Descriptor.RegisterSpace;
                                pParameters_1_0[n].Descriptor.ShaderRegister = desc_1_1.pParameters[n].Descriptor.ShaderRegister;
                                break;

                            case D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE:
                                const D3D12_ROOT_DESCRIPTOR_TABLE1& table_1_1 = desc_1_1.pParameters[n].DescriptorTable;

                                const SIZE_T DescriptorRangesSize = sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges;
                                void* pDescriptorRanges = (DescriptorRangesSize > 0 && SUCCEEDED(hr)) ? HeapAlloc(GetProcessHeap(), 0, DescriptorRangesSize) : nullptr;
                                if (DescriptorRangesSize > 0 && pDescriptorRanges == nullptr)
                                {
                                    hr = E_OUTOFMEMORY;
                                }
                                auto pDescriptorRanges_1_0 = reinterpret_cast<D3D12_DESCRIPTOR_RANGE*>(pDescriptorRanges);

                                if (SUCCEEDED(hr))
                                {
                                    for (UINT x = 0; x < table_1_1.NumDescriptorRanges; x++)
                                    {
                                        __analysis_assume(DescriptorRangesSize == sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges);
                                        pDescriptorRanges_1_0[x].BaseShaderRegister = table_1_1.pDescriptorRanges[x].BaseShaderRegister;
                                        pDescriptorRanges_1_0[x].NumDescriptors = table_1_1.pDescriptorRanges[x].NumDescriptors;
                                        pDescriptorRanges_1_0[x].OffsetInDescriptorsFromTableStart = table_1_1.pDescriptorRanges[x].OffsetInDescriptorsFromTableStart;
                                        pDescriptorRanges_1_0[x].RangeType = table_1_1.pDescriptorRanges[x].RangeType;
                                        pDescriptorRanges_1_0[x].RegisterSpace = table_1_1.pDescriptorRanges[x].RegisterSpace;
                                    }
                                }

                                D3D12_ROOT_DESCRIPTOR_TABLE& table_1_0 = pParameters_1_0[n].DescriptorTable;
                                table_1_0.NumDescriptorRanges = table_1_1.NumDescriptorRanges;
                                table_1_0.pDescriptorRanges = pDescriptorRanges_1_0;
                            }
                        }
                    }

                    if (SUCCEEDED(hr))
                    {
                        CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, desc_1_1.pStaticSamplers, desc_1_1.Flags);
                        hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob);
                    }

                    if (pParameters)
                    {
                        for (UINT n = 0; n < desc_1_1.NumParameters; n++)
                        {
                            if (desc_1_1.pParameters[n].ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE)
                            {
                                HeapFree(GetProcessHeap(), 0, reinterpret_cast<void*>(const_cast<D3D12_DESCRIPTOR_RANGE*>(pParameters_1_0[n].DescriptorTable.pDescriptorRanges)));
                            }
                        }
                        HeapFree(GetProcessHeap(), 0, pParameters);
                    }
                    return hr;
                }
            }
            break;

        case D3D_ROOT_SIGNATURE_VERSION_1_1:
            return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
    }

    return E_INVALIDARG;
}

//------------------------------------------------------------------------------------------------
struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY
{
    CD3DX12_RT_FORMAT_ARRAY() = default;
    explicit CD3DX12_RT_FORMAT_ARRAY(const D3D12_RT_FORMAT_ARRAY& o)
        : D3D12_RT_FORMAT_ARRAY(o)
    {}
    explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats)
    {
        NumRenderTargets = NumFormats;
        memcpy(RTFormats, pFormats, sizeof(
Download .txt
gitextract_j6n7_r9v/

├── CMakeLists.txt
├── CONTRIBUTING.md
├── DxbcParser/
│   ├── CMakeLists.txt
│   ├── include/
│   │   ├── BlobContainer.h
│   │   ├── DXBCUtils.h
│   │   └── pch.h
│   └── src/
│       ├── BlobContainer.cpp
│       └── DXBCUtils.cpp
├── LICENSE
├── README.md
├── SECURITY.md
├── external/
│   ├── MicrosoftTelemetry.h
│   ├── d3d12compatibility.h
│   └── d3dx12.h
├── include/
│   ├── Allocator.h
│   ├── BatchedContext.hpp
│   ├── BatchedQuery.hpp
│   ├── BatchedResource.hpp
│   ├── BlitHelper.hpp
│   ├── BlitHelperShaders.h
│   ├── BlockAllocators.h
│   ├── BlockAllocators.inl
│   ├── CommandListManager.hpp
│   ├── D3D12TranslationLayerDependencyIncludes.h
│   ├── D3D12TranslationLayerIncludes.h
│   ├── DXGIColorSpaceHelper.h
│   ├── DeviceChild.hpp
│   ├── DxbcBuilder.hpp
│   ├── Fence.hpp
│   ├── FormatDesc.hpp
│   ├── ImmediateContext.hpp
│   ├── ImmediateContext.inl
│   ├── MaxFrameLatencyHelper.hpp
│   ├── PipelineState.hpp
│   ├── PrecompiledShaders.h
│   ├── Query.hpp
│   ├── Residency.h
│   ├── Resource.hpp
│   ├── ResourceBinding.hpp
│   ├── ResourceCache.hpp
│   ├── ResourceState.hpp
│   ├── RootSignature.hpp
│   ├── Sampler.hpp
│   ├── Sampler.inl
│   ├── Shader.hpp
│   ├── Shader.inl
│   ├── ShaderBinary.h
│   ├── SharedResourceHelpers.hpp
│   ├── SubresourceHelpers.hpp
│   ├── SwapChainHelper.hpp
│   ├── SwapChainManager.hpp
│   ├── ThreadPool.hpp
│   ├── Util.hpp
│   ├── VideoDecode.hpp
│   ├── VideoDecodeStatistics.hpp
│   ├── VideoDevice.hpp
│   ├── VideoProcess.hpp
│   ├── VideoProcessEnum.hpp
│   ├── VideoProcessShaders.h
│   ├── VideoReferenceDataManager.hpp
│   ├── VideoViewHelper.hpp
│   ├── View.hpp
│   ├── View.inl
│   ├── XPlatHelpers.h
│   ├── commandlistmanager.inl
│   ├── pch.h
│   └── segmented_stack.h
├── packages.config
├── scripts/
│   ├── BlitHelperShaders.hlsl
│   ├── CompileBlitHelperShaders.cmd
│   ├── CompileVideoProcessShaders.cmd
│   └── DeinterlaceShader.hlsl
└── src/
    ├── Allocator.cpp
    ├── BatchedContext.cpp
    ├── BlitHelper.cpp
    ├── CMakeLists.txt
    ├── ColorConvertHelper.cpp
    ├── CommandListManager.cpp
    ├── DeviceChild.cpp
    ├── DxbcBuilder.cpp
    ├── Fence.cpp
    ├── FormatDescImpl.cpp
    ├── ImmediateContext.cpp
    ├── Main.cpp
    ├── MaxFrameLatencyHelper.cpp
    ├── PipelineState.cpp
    ├── Query.cpp
    ├── Residency.cpp
    ├── Resource.cpp
    ├── ResourceBinding.cpp
    ├── ResourceCache.cpp
    ├── ResourceState.cpp
    ├── RootSignature.cpp
    ├── Shader.cpp
    ├── ShaderBinary.cpp
    ├── ShaderParser.cpp
    ├── SharedResourceHelpers.cpp
    ├── SubresourceHelpers.cpp
    ├── SwapChainHelper.cpp
    ├── SwapChainManager.cpp
    ├── Util.cpp
    ├── VideoDecode.cpp
    ├── VideoDecodeStatistics.cpp
    ├── VideoDevice.cpp
    ├── VideoProcess.cpp
    ├── VideoProcessEnum.cpp
    ├── VideoReferenceDataManager.cpp
    └── View.cpp
Download .txt
SYMBOL INDEX (1569 symbols across 83 files)

FILE: DxbcParser/include/BlobContainer.h
  type DXBCFourCC (line 17) | typedef enum DXBCFourCC
  type DXBCHash (line 35) | typedef struct DXBCHash
  type DXBCVersion (line 40) | typedef struct DXBCVersion
  type DXBCHeader (line 46) | typedef struct DXBCHeader
  type DXBCHeader (line 57) | struct DXBCHeader
  type DXBCHeader (line 58) | struct DXBCHeader
  type DXBCBlobHeader (line 60) | typedef struct DXBCBlobHeader
  function class (line 90) | class CDXBCParser

FILE: DxbcParser/include/DXBCUtils.h
  type D3D11_SIGNATURE_PARAMETER (line 22) | typedef struct D3D11_SIGNATURE_PARAMETER
  function class (line 63) | class CSignatureParser
  function class (line 115) | class CSignatureParser5
  type SShaderFeatureInfo (line 179) | struct SShaderFeatureInfo

FILE: DxbcParser/src/BlobContainer.cpp
  function HRESULT (line 19) | HRESULT CDXBCParser::ReadDXBC( const void* pContainer, UINT ContainerSiz...
  function HRESULT (line 96) | HRESULT CDXBCParser::ReadDXBCAssumingValidSize( const void* pContainer )
  function UINT (line 107) | UINT CDXBCParser::FindNextMatchingBlob( DXBCFourCC SearchFourCC, UINT Se...
  function DXBCVersion (line 126) | const DXBCVersion* CDXBCParser::GetVersion()
  function DXBCHash (line 133) | const DXBCHash* CDXBCParser::GetHash()
  function UINT (line 140) | UINT CDXBCParser::GetBlobCount()
  function UINT (line 158) | UINT CDXBCParser::GetBlobSize( UINT BlobIndex )
  function UINT (line 169) | UINT CDXBCParser::GetBlobFourCC( UINT BlobIndex )
  function HRESULT (line 180) | HRESULT CDXBCParser::RelocateBytecode( UINT_PTR ByteOffset )

FILE: DxbcParser/src/DXBCUtils.cpp
  function UINT (line 8) | UINT DXBCGetSizeAssumingValidPointer(const void* pDXBC)
  function HRESULT (line 17) | HRESULT DXBCGetInputSignature( const void* pBlobContainer, CSignaturePar...
  function HRESULT (line 56) | HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignaturePa...
  function HRESULT (line 106) | HRESULT DXBCGetOutputSignature( const void* pBlobContainer, CSignaturePa...
  function HRESULT (line 142) | HRESULT DXBCGetPatchConstantSignature( const void* pBlobContainer, CSign...
  function HRESULT (line 218) | HRESULT BoundedStringLength(__in_ecount(pEnd-pBegin) const char *pBegin,
  type _D3D10_INTERNALSHADER_SIGNATURE (line 246) | struct _D3D10_INTERNALSHADER_SIGNATURE
  type _D3D10_INTERNALSHADER_PARAMETER (line 252) | struct _D3D10_INTERNALSHADER_PARAMETER
  type _D3D11_INTERNALSHADER_PARAMETER_11_1 (line 290) | struct _D3D11_INTERNALSHADER_PARAMETER_11_1
  type _D3D11_INTERNALSHADER_PARAMETER_FOR_GS (line 331) | struct _D3D11_INTERNALSHADER_PARAMETER_FOR_GS
  function D3D10_SB_NAME (line 370) | inline D3D10_SB_NAME ConvertToSB(D3D10_NAME Value, UINT SemanticIndex)
  function D3D10_SB_RESOURCE_DIMENSION (line 465) | inline D3D10_SB_RESOURCE_DIMENSION ConvertToSB(D3D11_SRV_DIMENSION Value)
  function D3D10_SB_RESOURCE_DIMENSION (line 500) | inline D3D10_SB_RESOURCE_DIMENSION ConvertToSB(D3D11_UAV_DIMENSION Value)
  function D3D10_SB_REGISTER_COMPONENT_TYPE (line 526) | inline D3D10_SB_REGISTER_COMPONENT_TYPE ConvertToSB(D3D10_REGISTER_COMPO...
  function HRESULT (line 548) | HRESULT CSignatureParser::ReadSignature11_1( __in_bcount(BlobSize) const...
  function HRESULT (line 658) | HRESULT CSignatureParser::ReadSignature4( __in_bcount(BlobSize) const vo...
  function HRESULT (line 767) | HRESULT CSignatureParser::ReadSignature11_1( D3D11_SIGNATURE_PARAMETER* ...
  function HRESULT (line 786) | HRESULT CSignatureParser::ReadSignature5( D3D11_SIGNATURE_PARAMETER* pPa...
  function HRESULT (line 843) | HRESULT CSignatureParser5::ReadSignature11_1( __in_bcount(BlobSize) cons...
  function HRESULT (line 976) | HRESULT CSignatureParser5::ReadSignature5( __in_bcount(BlobSize) const v...
  function HRESULT (line 1106) | HRESULT CSignatureParser5::ReadSignature4( const void* pSignature, UINT ...
  function UINT (line 1131) | UINT CSignatureParser::GetParameters( D3D11_SIGNATURE_PARAMETER const** ...
  function UINT (line 1142) | static UINT LowerCaseCharSum(LPCSTR pStr)
  function HRESULT (line 1158) | HRESULT CSignatureParser::FindParameter( LPCSTR SemanticName, UINT  Sema...
  function HRESULT (line 1178) | HRESULT CSignatureParser::FindParameterRegister( LPCSTR SemanticName, UI...
  function UINT (line 1197) | UINT CSignatureParser::GetSemanticNameCharSum( UINT parameter )

FILE: external/d3d12compatibility.h
  type interface (line 48) | typedef interface ID3D12CompatibilityDevice
  type interface (line 55) | typedef interface ID3D12CompatibilityQueue
  type D3D12_COMPATIBILITY_SHARED_FLAGS (line 76) | typedef
  type D3D12_REFLECT_SHARED_PROPERTY (line 86) | typedef
  type ID3D12CompatibilityDeviceVtbl (line 144) | typedef struct ID3D12CompatibilityDeviceVtbl
  function interface (line 190) | interface ID3D12CompatibilityDevice
  type ID3D12CompatibilityQueueVtbl (line 263) | typedef struct ID3D12CompatibilityQueueVtbl
  function interface (line 296) | interface ID3D12CompatibilityQueue

FILE: external/d3dx12.h
  type CD3DX12_DEFAULT (line 19) | struct CD3DX12_DEFAULT {}
  function D3D12_RECT (line 34) | struct CD3DX12_RECT : public D3D12_RECT
  function D3D12_VIEWPORT (line 54) | struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT
  function D3D12_BOX (line 116) | struct CD3DX12_BOX : public D3D12_BOX
  function D3D12_DEPTH_STENCIL_DESC (line 171) | struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC
  function D3D12_DEPTH_STENCIL_DESC1 (line 224) | struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1
  function D3D12_RASTERIZER_DESC (line 341) | struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC
  function D3D12_RESOURCE_ALLOCATION_INFO (line 389) | struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATI...
  function D3D12_HEAP_PROPERTIES (line 405) | struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES
  function D3D12_HEAP_DESC (line 451) | struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
  function D3D12_CLEAR_VALUE (line 536) | struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
  function D3D12_RANGE (line 562) | struct CD3DX12_RANGE : public D3D12_RANGE
  function D3D12_RANGE_UINT64 (line 578) | struct CD3DX12_RANGE_UINT64 : public D3D12_RANGE_UINT64
  function D3D12_SUBRESOURCE_RANGE_UINT64 (line 594) | struct CD3DX12_SUBRESOURCE_RANGE_UINT64 : public D3D12_SUBRESOURCE_RANGE...
  function D3D12_SHADER_BYTECODE (line 619) | struct CD3DX12_SHADER_BYTECODE : public D3D12_SHADER_BYTECODE
  function D3D12_TILED_RESOURCE_COORDINATE (line 641) | struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_C...
  function D3D12_TILE_REGION_SIZE (line 661) | struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE
  function D3D12_SUBRESOURCE_TILING (line 683) | struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING
  function D3D12_TILE_SHAPE (line 703) | struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE
  function D3D12_RESOURCE_BARRIER (line 721) | struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
  function D3D12_PACKED_MIP_INFO (line 767) | struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO
  function D3D12_SUBRESOURCE_FOOTPRINT (line 787) | struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
  function explicit (line 806) | explicit CD3DX12_SUBRESOURCE_FOOTPRINT(
  function D3D12_TEXTURE_COPY_LOCATION (line 819) | struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION
  function D3D12_DESCRIPTOR_RANGE (line 846) | struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
  function D3D12_ROOT_DESCRIPTOR_TABLE (line 892) | struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE
  function Init (line 905) | inline void Init(
  function Init (line 912) | static inline void Init(
  function D3D12_ROOT_CONSTANTS (line 923) | struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS
  function D3D12_ROOT_DESCRIPTOR (line 958) | struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR
  function D3D12_ROOT_PARAMETER (line 986) | struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER
  function InitAsDescriptorTable (line 1049) | inline void InitAsDescriptorTable(
  function D3D12_STATIC_SAMPLER_DESC (line 1092) | struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC
  function D3D12_ROOT_SIGNATURE_DESC (line 1194) | struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC
  function CD3DX12_ROOT_SIGNATURE_DESC (line 1209) | CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
  function D3D12_DESCRIPTOR_RANGE1 (line 1241) | struct CD3DX12_DESCRIPTOR_RANGE1 : public D3D12_DESCRIPTOR_RANGE1
  function D3D12_ROOT_DESCRIPTOR_TABLE1 (line 1291) | struct CD3DX12_ROOT_DESCRIPTOR_TABLE1 : public D3D12_ROOT_DESCRIPTOR_TABLE1
  function Init (line 1304) | inline void Init(
  function Init (line 1311) | static inline void Init(
  function D3D12_ROOT_DESCRIPTOR1 (line 1322) | struct CD3DX12_ROOT_DESCRIPTOR1 : public D3D12_ROOT_DESCRIPTOR1
  function D3D12_ROOT_PARAMETER1 (line 1357) | struct CD3DX12_ROOT_PARAMETER1 : public D3D12_ROOT_PARAMETER1
  function InitAsDescriptorTable (line 1423) | inline void InitAsDescriptorTable(
  function D3D12_VERSIONED_ROOT_SIGNATURE_DESC (line 1469) | struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_RO...
  function CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC (line 1503) | CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
  function D3D12_CPU_DESCRIPTOR_HANDLE (line 1562) | struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE
  function D3D12_GPU_DESCRIPTOR_HANDLE (line 1623) | struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
  function UINT (line 1684) | inline UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT P...
  function D3D12DecomposeSubresource (line 1691) | void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT A...
  function UINT8 (line 1699) | inline UINT8 D3D12GetFormatPlaneCount(
  function D3D12_RESOURCE_DESC (line 1713) | struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
  function CD3DX12_RESOURCE_DESC (line 1744) | static inline CD3DX12_RESOURCE_DESC Buffer(
  function UINT8 (line 1803) | inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
  function UINT (line 1805) | inline UINT Subresources(_In_ ID3D12Device* pDevice) const
  function UINT (line 1807) | inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSl...
  function D3D12_RESOURCE_DESC1 (line 1828) | struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
  function CD3DX12_RESOURCE_DESC1 (line 1865) | static inline CD3DX12_RESOURCE_DESC1 Buffer(
  function UINT8 (line 1928) | inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
  function UINT (line 1930) | inline UINT Subresources(_In_ ID3D12Device* pDevice) const
  function UINT (line 1932) | inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSl...
  function D3D12_VIEW_INSTANCING_DESC (line 1956) | struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC
  function MemcpySubresource (line 1981) | inline void MemcpySubresource(
  function D3D12IsLayoutOpaque (line 2141) | inline bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout )
  function ID3D12CommandList (line 2146) | ID3D12CommandList * const * CommandListCast(t_CommandListType * const * pp)
  function HRESULT (line 2160) | inline HRESULT D3DX12SerializeVersionedRootSignature(
  function D3D12_RT_FORMAT_ARRAY (line 2276) | struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY
  type DefaultSampleMask (line 2297) | struct DefaultSampleMask { operator UINT() { return UINT_MAX; }
  type DefaultSampleDesc (line 2298) | struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() { return DXGI_SAM...
  function CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT (line 2303) | alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT
  function operator (line 2312) | operator InnerStructType const&() const { return _Inner; }
  type ID3DX12PipelineParserCallbacks (line 2347) | struct ID3DX12PipelineParserCallbacks
  type CD3DX12_PIPELINE_STATE_STREAM1 (line 2407) | struct CD3DX12_PIPELINE_STATE_STREAM1
  function D3D12_GRAPHICS_PIPELINE_STATE_DESC (line 2488) | D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const
  type CD3DX12_PIPELINE_MESH_STATE_STREAM (line 2527) | struct CD3DX12_PIPELINE_MESH_STATE_STREAM
  function ComputeDescV0 (line 2586) | struct CD3DX12_PIPELINE_STATE_STREAM
  function D3D12_PIPELINE_STATE_SUBOBJECT_TYPE (line 2737) | inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3...
  function HRESULT (line 2748) | inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STRE...
  function class (line 2983) | class CD3DX12_STATE_OBJECT_DESC
  function SetStateObjectType (line 2994) | void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) { m_Desc.Type = Ty...
  function Init (line 3080) | void Init(D3D12_STATE_OBJECT_TYPE Type)
  type SUBOBJECT_WRAPPER (line 3089) | struct SUBOBJECT_WRAPPER
  function class (line 3103) | class StringContainer
  function clear (line 3126) | void clear() { m_Strings.clear(); }
  function class (line 3131) | class SUBOBJECT_HELPER_BASE
  function class (line 3150) | class OWNED_HELPER
  function class (line 3176) | class CD3DX12_DXIL_LIBRARY_SUBOBJECT
  function DefineExports (line 3215) | void DefineExports(LPCWSTR* Exports, UINT N)
  function SetExistingCollection (line 3256) | void SetExistingCollection(ID3D12StateObject*pExistingCollection)
  function DefineExports (line 3282) | void DefineExports(LPCWSTR* Exports, UINT N)
  function SetSubobjectToAssociate (line 3325) | void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAss...
  function AddExport (line 3329) | void AddExport(LPCWSTR Export)
  function AddExports (line 3343) | void AddExports(LPCWSTR* Exports, UINT N)
  function SetSubobjectNameToAssociate (line 3384) | void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate)
  function AddExport (line 3388) | void AddExport(LPCWSTR Export)
  function AddExports (line 3402) | void AddExports(LPCWSTR* Exports, UINT N)
  function SetHitGroupExport (line 3445) | void SetHitGroupExport(LPCWSTR exportName)
  function SetHitGroupType (line 3449) | void SetHitGroupType(D3D12_HIT_GROUP_TYPE Type) { m_Desc.Type = Type; }
  function SetAnyHitShaderImport (line 3450) | void SetAnyHitShaderImport(LPCWSTR importName)
  function SetClosestHitShaderImport (line 3454) | void SetClosestHitShaderImport(LPCWSTR importName)
  function SetIntersectionShaderImport (line 3458) | void SetIntersectionShaderImport(LPCWSTR importName)
  function Config (line 3499) | void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes)
  function Config (line 3534) | void Config(UINT MaxTraceRecursionDepth)
  function Config (line 3568) | void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS...
  function SetRootSignature (line 3603) | void SetRootSignature(ID3D12RootSignature* pRootSig)
  function SetFlags (line 3671) | void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags)
  function SetNodeMask (line 3705) | void SetNodeMask(UINT NodeMask)

FILE: include/Allocator.h
  function namespace (line 5) | namespace D3D12TranslationLayer
  function class (line 20) | class InternalHeapAllocator
  function _BlockType (line 49) | _BlockType Allocate(_SizeType size) {
  function Deallocate (line 53) | void Deallocate(const _BlockType &block) { m_InnerAllocator.Deallocate(b...
  type typename (line 55) | typedef typename std::invoke_result<decltype(&InnerAllocatorDecayed::All...
  function IsOwner (line 57) | inline bool IsOwner(_In_ const _BlockType &block) const { return block.G...
  function AllocationType (line 58) | AllocationType GetInnerAllocation(const _BlockType &block) const { retur...
  function _SizeType (line 59) | _SizeType GetInnerAllocationOffset(const _BlockType &block) const { retu...
  type DirectAllocator (line 64) | typedef DirectAllocator<HeapSuballocationBlock, InternalHeapAllocator, U...
  type BlockAllocators (line 65) | typedef BlockAllocators::CDisjointBuddyAllocator<HeapSuballocationBlock,...
  function class (line 67) | class ThreadSafeBuddyHeapAllocator : DisjointBuddyHeapAllocator
  function m_pfnUseDirectHeapAllocator (line 118) | m_pfnUseDirectHeapAllocator(pfnRequiresDirectHeapAllocator)
  function _BlockType (line 122) | _BlockType Allocate(_SizeType size, AllocationArgs args)
  function Deallocate (line 128) | void Deallocate(const _BlockType &block)
  function IsOwner (line 135) | bool IsOwner(const _BlockType &block) const
  function Reset (line 141) | void Reset()
  function _SizeType (line 154) | _SizeType GetInnerAllocationOffset(const _BlockType &block) const

FILE: include/BatchedContext.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class BatchedQuery (line 8) | class BatchedQuery
    type BatchedExtension (line 10) | struct BatchedExtension
    class FreePageContainer (line 15) | class FreePageContainer
      class LockedAdder (line 21) | class LockedAdder
        method LockedAdder (line 28) | LockedAdder(FreePageContainer& Container) noexcept
      method FreePageContainer (line 34) | FreePageContainer(bool bAllocCS) : m_CS(bAllocCS) {}
    class BatchedContext (line 39) | class BatchedContext
      type BatchStorageAllocator (line 47) | struct BatchStorageAllocator
      class Batch (line 56) | class Batch
        method Batch (line 69) | Batch(BatchStorageAllocator const& allocator)
      type CmdSetPipelineState (line 90) | struct CmdSetPipelineState
      type CmdDrawInstanced (line 95) | struct CmdDrawInstanced
      type CmdDrawIndexedInstanced (line 103) | struct CmdDrawIndexedInstanced
      type CmdDispatch (line 112) | struct CmdDispatch
      type CmdDrawAuto (line 117) | struct CmdDrawAuto
      type CmdDrawInstancedIndirect (line 121) | struct CmdDrawInstancedIndirect
      type CmdDrawIndexedInstancedIndirect (line 127) | struct CmdDrawIndexedInstancedIndirect
      type CmdDispatchIndirect (line 133) | struct CmdDispatchIndirect
      type CmdSetTopology (line 139) | struct CmdSetTopology
      type CmdSetVertexBuffers (line 144) | struct CmdSetVertexBuffers
      type CmdSetIndexBuffer (line 154) | struct CmdSetIndexBuffer
      type CmdSetShaderResources (line 161) | struct CmdSetShaderResources
      type CmdSetSamplers (line 169) | struct CmdSetSamplers
      type CmdSetConstantBuffers (line 177) | struct CmdSetConstantBuffers
      type CmdSetConstantBuffersNullOffsetSize (line 188) | struct CmdSetConstantBuffersNullOffsetSize
      type CmdSetSOBuffers (line 196) | struct CmdSetSOBuffers
      type CmdSetRenderTargets (line 202) | struct CmdSetRenderTargets
      type CmdSetUAV (line 208) | struct CmdSetUAV
      type CmdSetStencilRef (line 216) | struct CmdSetStencilRef
      type CmdSetBlendFactor (line 221) | struct CmdSetBlendFactor
      type CmdSetViewport (line 226) | struct CmdSetViewport
      type CmdSetNumViewports (line 232) | struct CmdSetNumViewports
      type CmdSetScissorRect (line 237) | struct CmdSetScissorRect
      type CmdSetNumScissorRects (line 243) | struct CmdSetNumScissorRects
      type CmdSetScissorEnable (line 248) | struct CmdSetScissorEnable
      type CmdClearView (line 254) | struct CmdClearView
        method CmdClearView (line 260) | CmdClearView(View* _pView, const ColorType _color[4], UINT _numRec...
      type CmdClearRenderTargetView (line 262) | struct CmdClearRenderTargetView : CmdClearView<RTV>
        method CmdClearRenderTargetView (line 265) | CmdClearRenderTargetView(RTV* _pView, const FLOAT _color[4], UINT ...
      type CmdClearDepthStencilView (line 267) | struct CmdClearDepthStencilView
      type CmdClearUnorderedAccessViewUint (line 277) | struct CmdClearUnorderedAccessViewUint : CmdClearView<UAV, UINT>
        method CmdClearUnorderedAccessViewUint (line 280) | CmdClearUnorderedAccessViewUint(UAV* _pView, const UINT _color[4],...
      type CmdClearUnorderedAccessViewFloat (line 282) | struct CmdClearUnorderedAccessViewFloat : CmdClearView<UAV, FLOAT>
        method CmdClearUnorderedAccessViewFloat (line 285) | CmdClearUnorderedAccessViewFloat(UAV* _pView, const FLOAT _color[4...
      type CmdClearVideoDecoderOutputView (line 287) | struct CmdClearVideoDecoderOutputView : CmdClearView<VDOV>
        method CmdClearVideoDecoderOutputView (line 290) | CmdClearVideoDecoderOutputView(VDOV* _pView, const FLOAT _color[4]...
      type CmdClearVideoProcessorInputView (line 292) | struct CmdClearVideoProcessorInputView : CmdClearView<VPIV>
        method CmdClearVideoProcessorInputView (line 295) | CmdClearVideoProcessorInputView(VPIV* _pView, const FLOAT _color[4...
      type CmdClearVideoProcessorOutputView (line 297) | struct CmdClearVideoProcessorOutputView : CmdClearView<VPOV>
        method CmdClearVideoProcessorOutputView (line 300) | CmdClearVideoProcessorOutputView(VPOV* _pView, const FLOAT _color[...
      type CmdDiscardView (line 302) | struct CmdDiscardView
      type CmdDiscardResource (line 309) | struct CmdDiscardResource
      type CmdGenMips (line 316) | struct CmdGenMips
      type CmdFinalizeUpdateSubresources (line 322) | struct CmdFinalizeUpdateSubresources
      type CmdFinalizeUpdateSubresourcesWithLocalPlacement (line 328) | struct CmdFinalizeUpdateSubresourcesWithLocalPlacement
      type CmdRename (line 334) | struct CmdRename
      type CmdRenameViaCopy (line 340) | struct CmdRenameViaCopy
      type CmdQueryBegin (line 347) | struct CmdQueryBegin
      type CmdQueryEnd (line 352) | struct CmdQueryEnd
      type CmdSetPredication (line 357) | struct CmdSetPredication
      type CmdResourceCopy (line 363) | struct CmdResourceCopy
      type CmdResolveSubresource (line 369) | struct CmdResolveSubresource
      type CmdResourceCopyRegion (line 378) | struct CmdResourceCopyRegion
      type CmdSetResourceMinLOD (line 388) | struct CmdSetResourceMinLOD
      type CmdCopyStructureCount (line 394) | struct CmdCopyStructureCount
      type CmdRotateResourceIdentities (line 401) | struct CmdRotateResourceIdentities
      type CmdExtension (line 407) | struct CmdExtension
      type CmdSetHardwareProtection (line 416) | struct CmdSetHardwareProtection
      type CmdSetHardwareProtectionState (line 422) | struct CmdSetHardwareProtectionState
      type CmdClearState (line 427) | struct CmdClearState
      type CmdUpdateTileMappings (line 431) | struct CmdUpdateTileMappings
      type CmdCopyTileMappings (line 453) | struct CmdCopyTileMappings
      type CmdCopyTiles (line 463) | struct CmdCopyTiles
      type CmdTiledResourceBarrier (line 473) | struct CmdTiledResourceBarrier
      type CmdResizeTilePool (line 479) | struct CmdResizeTilePool
      type CmdExecuteNestedBatch (line 485) | struct CmdExecuteNestedBatch
      type CmdSetMarker (line 491) | struct CmdSetMarker
      type CmdBeginEvent (line 497) | struct CmdBeginEvent
      type CmdEndEvent (line 503) | struct CmdEndEvent
      type CreationArgs (line 511) | struct CreationArgs
      type Callbacks (line 517) | struct Callbacks
      method ImmediateContext (line 534) | ImmediateContext &FlushBatchAndGetImmediateContext()
      method ImmediateContext (line 540) | ImmediateContext &GetImmediateContextNoFlush()
      method AddPostBatchFunction (line 545) | void AddPostBatchFunction(TFunc&& f)
      method ReleaseResource (line 555) | ReleaseResource(Resource* pResource)
      method Flush (line 581) | Flush(UINT commandListMask)
      method BatchExtension (line 688) | void BatchExtension(BatchedExtension* pExt, T const& Data)
      method EmplaceBatchExtension (line 694) | void EmplaceBatchExtension(BatchedExtension* pExt, Args&&... args)
      method AddToBatch (line 724) | void AddToBatch(TCmd const& command)
    type BatchedDeleter (line 793) | struct BatchedDeleter
    class BatchedDeviceChild (line 802) | class BatchedDeviceChild
      method BatchedDeviceChild (line 805) | BatchedDeviceChild(BatchedContext& Parent) noexcept
    class BatchedDeviceChildImpl (line 815) | class BatchedDeviceChildImpl : public BatchedDeviceChild
      method BatchedDeviceChildImpl (line 819) | BatchedDeviceChildImpl(BatchedContext& Parent, Args&&... args)
      method TImmediate (line 826) | TImmediate& FlushBatchAndGetImmediate() { ProcessBatch(); return *m_...
      method TImmediate (line 827) | TImmediate& GetImmediateNoFlush() { return *m_pImmediate; }

FILE: include/BatchedQuery.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class BatchedQuery (line 7) | class BatchedQuery : public BatchedDeviceChild
      method BatchedQuery (line 13) | BatchedQuery(BatchedContext& Context, Async* pAsync, bool ownsAsync)
      method Async (line 19) | Async* GetImmediateNoFlush() { return m_pImmediateAsyncWeak; }
      method Async (line 20) | Async* FlushBatchAndGetImmediate() { ProcessBatch(); return m_pImmed...

FILE: include/BatchedResource.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class BatchedResource (line 8) | class BatchedResource : public BatchedDeviceChild
      method BatchedResource (line 11) | BatchedResource(BatchedContext& Context, Resource* underlyingResourc...
      type BatchedDeleter (line 22) | struct BatchedDeleter

FILE: include/BlitHelper.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class ImmediateContext (line 8) | class ImmediateContext
    class Resource (line 9) | class Resource
    type Bits (line 13) | struct Bits
    class BlitHelper (line 26) | class BlitHelper

FILE: include/BlockAllocators.h
  function namespace (line 23) | namespace BlockAllocators
  function Deallocate (line 73) | void Deallocate(_BlockType &block) { assert(block.GetSize() == 0); }
  function IsOwner (line 74) | bool IsOwner(_BlockType &block) const { return block.GetSize() == 0 && b...
  function Reset (line 75) | void Reset() {}
  function IsOwner (line 108) | bool IsOwner(const _BlockType &block) const { return block.GetSize() == ...
  function UINT (line 113) | inline UINT Log2Ceil(UINT64 value)
  function UINT (line 150) | inline UINT Log2Ceil(UINT32 value)
  function UINT32 (line 162) | inline UINT32 Log2Ceil(SIZE_T value)
  function T (line 246) | T* allocate(size_t size)
  function deallocate (line 250) | void deallocate(T* p, size_t size)
  function o (line 259) | bool operator==(PoolingStdAllocator const& o) const { return o.m_pAlloca...
  function o (line 260) | bool operator!=(PoolingStdAllocator const& o) const { return o.m_pAlloca...
  function explicit (line 262) | explicit PoolingStdAllocator(UnderlyingAllocatorImpl& underlying)
  function _SizeType (line 296) | inline _SizeType SizeToUnitSize(_SizeType size) const
  function UINT (line 301) | inline UINT UnitSizeToOrder(_SizeType size) const
  function _SizeType (line 306) | inline _SizeType GetBuddyOffset(const _SizeType &offset, const _SizeType...
  function _SizeType (line 311) | inline _SizeType OrderToUnitSize(UINT order) const { return ((_SizeType)...
  function IsOwner (line 328) | inline bool IsOwner(_In_ const _BlockType &block) const
  function Reset (line 333) | inline void Reset()
  type RefcountedAllocation (line 382) | struct RefcountedAllocation
  function UINT (line 391) | inline UINT BucketFromOffset(_SizeType offset) const { return UINT(offse...
  function _BlockType (line 429) | _BlockType Allocate(_SizeType size)
  function Deallocate (line 434) | void Deallocate(const _BlockType &block)
  function IsOwner (line 440) | bool IsOwner(const _BlockType &block) const
  function Reset (line 445) | void Reset()
  function _SizeType (line 457) | _SizeType GetInnerAllocationOffset(const _BlockType &block) const

FILE: include/CommandListManager.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class ImmediateContext (line 9) | class ImmediateContext
    class CommandListManager (line 11) | class CommandListManager
      method SetNeedSubmitFence (line 25) | void SetNeedSubmitFence() noexcept { m_bNeedSubmitFence = true; }
      method HasCommands (line 26) | bool HasCommands() const noexcept { return m_NumCommands > 0; }
      method NeedSubmitFence (line 27) | bool NeedSubmitFence() const noexcept { return m_bNeedSubmitFence; }
      method ShouldFlushForResourceAcquire (line 28) | bool ShouldFlushForResourceAcquire() const noexcept { return HasComm...
      method ExecuteCommandQueueCommand (line 29) | void ExecuteCommandQueueCommand(TFunc&& func)
      method CloseCommandList (line 44) | void CloseCommandList() { CloseCommandList(nullptr); }
      method UINT64 (line 53) | UINT64 GetCompletedFenceValue() noexcept { return m_Fence.GetComplet...
      method HANDLE (line 56) | HANDLE GetEvent() noexcept { return m_hWaitEvent; }
      method UINT64 (line 59) | UINT64 GetCommandListID() { return m_commandListID; }
      method UINT64 (line 60) | UINT64 GetCommandListIDInterlockedRead() { return InterlockedRead64(...
      method COMMAND_LIST_TYPE (line 61) | COMMAND_LIST_TYPE GetCommandListType() { return m_type; }
      method ID3D12CommandQueue (line 62) | ID3D12CommandQueue* GetCommandQueue() { return m_pCommandQueue.get(); }
      method ID3D12CommandList (line 63) | ID3D12CommandList* GetCommandList() { return m_pCommandList.get(); }
      method ID3D12SharingContract (line 64) | ID3D12SharingContract* GetSharingContract() { return m_pSharingContr...
      method Fence (line 65) | Fence* GetFence() { return &m_Fence; }
      method ID3D12VideoDecodeCommandList2 (line 67) | ID3D12VideoDecodeCommandList2* GetVideoDecodeCommandList(ID3D12Comma...
      method ID3D12VideoProcessCommandList2 (line 68) | ID3D12VideoProcessCommandList2* GetVideoProcessCommandList(ID3D12Com...
      method ID3D12GraphicsCommandList (line 69) | ID3D12GraphicsCommandList* GetGraphicsCommandList(ID3D12CommandList ...
      method ComputeOnly (line 72) | bool ComputeOnly() {return !!(m_pParent->FeatureLevel() == D3D_FEATU...
      method ResetCommandListTrackingData (line 75) | void ResetCommandListTrackingData()
      method UINT (line 121) | static constexpr UINT GetMaxInFlightDepth(COMMAND_LIST_TYPE type)

FILE: include/D3D12TranslationLayerIncludes.h
  function namespace (line 67) | namespace D3D12TranslationLayer

FILE: include/DXGIColorSpaceHelper.h
  function class (line 10) | class CDXGIColorSpaceHelper

FILE: include/DeviceChild.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class ImmediateContext (line 7) | class ImmediateContext
    function MarkUsedInCommandListIfNewer (line 9) | class DeviceChild
    function ResetLastUsedInCommandList (line 38) | void ResetLastUsedInCommandList()
    function AddToDeferredDeletionQueue (line 43) | protected:
    function AddToDeferredDeletionQueue (line 55) | void AddToDeferredDeletionQueue(unique_comptr<TIface>& spObject, COMMA...
    function AddToDeferredDeletionQueue (line 65) | void AddToDeferredDeletionQueue(unique_comptr<TIface>& spObject, COMMA...
    function SwapIdentities (line 70) | void SwapIdentities(DeviceChild& Other)
  class DeviceChildImpl (line 85) | class DeviceChildImpl : public DeviceChild
    method DeviceChildImpl (line 88) | DeviceChildImpl(ImmediateContext* pParent) noexcept
    method Destroy (line 92) | void Destroy() { AddToDeferredDeletionQueue(m_spIface); }
    method Created (line 95) | bool Created() { return m_spIface.get() != nullptr; }
    method TIface (line 96) | TIface** GetForCreate() { Destroy(); return &m_spIface; }
    method TIface (line 97) | TIface* GetForUse(COMMAND_LIST_TYPE CommandListType, UINT64 CommandLis...
    method TIface (line 102) | TIface* GetForUse(COMMAND_LIST_TYPE CommandListType)
    method TIface (line 106) | TIface* GetForImmediateUse() { return m_spIface.get(); }

FILE: include/DxbcBuilder.hpp
  class CDXBCBuilder (line 17) | class CDXBCBuilder
    method CDXBCBuilder (line 21) | CDXBCBuilder(bool bMakeInternalCopiesOfBlobs)
    type BlobNode (line 75) | struct BlobNode

FILE: include/Fence.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type FENCE_FLAGS (line 7) | enum FENCE_FLAGS
    class Fence (line 17) | class Fence : public DeviceChild
      method Fence (line 23) | Fence(Fence const&) = delete;
      method Fence (line 24) | Fence& operator=(Fence const&) = delete;
      method Fence (line 25) | Fence(Fence&&) = delete;
      method Fence (line 26) | Fence& operator=(Fence&&) = delete;
      method GetCompletedValue (line 30) | GetCompletedValue() const { return m_spFence->GetCompletedValue(); }
      method Signal (line 31) | Signal(UINT64 Value) const { ThrowFailure(m_spFence->Signal(Value)); }
      method SetEventOnCompletion (line 32) | SetEventOnCompletion(UINT64 Value, HANDLE hEvent) const { return m_s...
      method DeferredWaits (line 40) | bool DeferredWaits() const { return m_bDeferredWaits; }
      method ID3D12Fence1 (line 41) | ID3D12Fence1* Get() const { return m_spFence.get(); }

FILE: include/FormatDesc.hpp
  type D3D11_FORMAT_LAYOUT (line 12) | enum D3D11_FORMAT_LAYOUT
  type D3D11_FORMAT_TYPE_LEVEL (line 20) | enum D3D11_FORMAT_TYPE_LEVEL
  type D3D11_FORMAT_COMPONENT_NAME (line 29) | enum D3D11_FORMAT_COMPONENT_NAME
  type D3D11_FORMAT_COMPONENT_INTERPRETATION (line 42) | enum D3D11_FORMAT_COMPONENT_INTERPRETATION
  class CD3D11FormatHelper (line 61) | class CD3D11FormatHelper
    type FORMAT_DETAIL (line 69) | struct FORMAT_DETAIL
    method BOOL (line 123) | static BOOL                                 Opaque(DXGI_FORMAT Format)...

FILE: include/ImmediateContext.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class Resource (line 7) | class Resource
    class CommandListManager (line 8) | class CommandListManager
    type TranslationLayerCallbacks (line 10) | struct TranslationLayerCallbacks
    class CFencePool (line 20) | class CFencePool
      method ReturnToPool (line 23) | void ReturnToPool(TResourceType&& Resource, UINT64 FenceValue) noexcept
      method TResourceType (line 38) | TResourceType RetrieveFromPool(UINT64 CurrentFenceValue, PFNCreateNe...
      method Trim (line 53) | void Trim(UINT64 TrimThreshold, UINT64 CurrentFenceValue)
      method CFencePool (line 74) | CFencePool(bool bLock = false) noexcept
      method CFencePool (line 78) | CFencePool(CFencePool &&other) noexcept
      method CFencePool (line 83) | CFencePool& operator=(CFencePool &&other) noexcept
      method CFencePool (line 94) | CFencePool(CFencePool const& other) = delete;
      method CFencePool (line 95) | CFencePool& operator=(CFencePool const& other) = delete;
    class CBoundedFencePool (line 108) | class CBoundedFencePool : public CFencePool<TResourceType>
      method TResourceType (line 113) | TResourceType RetrieveFromPool(UINT64 CurrentFenceValue, PFNWaitForF...
      method CBoundedFencePool (line 140) | CBoundedFencePool(bool bLock = false, UINT MaxInFlightDepth = UINT_M...
      method CBoundedFencePool (line 145) | CBoundedFencePool(CBoundedFencePool&& other) noexcept
      method CBoundedFencePool (line 150) | CBoundedFencePool& operator=(CBoundedFencePool&& other) noexcept
    class CMultiLevelPool (line 167) | class CMultiLevelPool
      method CMultiLevelPool (line 170) | CMultiLevelPool(UINT64 TrimThreshold, bool bLock)
      method ReturnToPool (line 176) | void ReturnToPool(UINT64 Size, TResourceType&& Resource, UINT64 Fenc...
      method TResourceType (line 190) | TResourceType RetrieveFromPool(UINT64 Size, UINT64 CurrentFenceValue...
      method Trim (line 215) | void Trim(UINT64 CurrentFenceValue)
      method UINT (line 226) | UINT IndexFromSize(UINT64 Size) noexcept { return (Size == 0) ? 0 : ...
    class CFencedRingBuffer (line 245) | class CFencedRingBuffer
      method CFencedRingBuffer (line 249) | CFencedRingBuffer(UINT32 Size = 0)
      method HRESULT (line 255) | HRESULT Allocate(UINT32 NumItems, UINT64 CurrentFenceValue, _Out_ UI...
      method Deallocate (line 303) | void Deallocate(UINT64 CompletedFenceValue)
      method UINT32 (line 330) | inline UINT32 DereferenceTail() const { return m_Tail % m_Size; }
      type LedgerEntry (line 336) | struct LedgerEntry
      method LedgerEntry (line 351) | LedgerEntry& GetCurrentLedgeEntry() { return  m_Ledger[m_LedgerIndex...
      method IsLedgerEntryAvailable (line 353) | bool IsLedgerEntryAvailable(UINT32 Index) const { return (m_LedgerMa...
      method HRESULT (line 355) | HRESULT MoveToNextLedgerEntry(UINT64 CurrentFenceValue)
    class CDescriptorHeapManager (line 380) | class CDescriptorHeapManager
      type SFreeRange (line 388) | struct SFreeRange { HeapOffsetRaw Start; HeapOffsetRaw End; }
      type SHeapEntry (line 389) | struct SHeapEntry
        method SHeapEntry (line 394) | SHeapEntry() { }
        method SHeapEntry (line 395) | SHeapEntry(SHeapEntry &&o) : m_Heap(std::move(o.m_Heap)), m_FreeLi...
      method CDescriptorHeapManager (line 405) | CDescriptorHeapManager(ID3D12Device* pDevice,
      method HeapOffset (line 420) | HeapOffset AllocateHeapSlot(_Out_opt_ HeapIndex *outIndex = nullptr)...
      method FreeHeapSlot (line 450) | void FreeHeapSlot(HeapOffset Offset, HeapIndex index) noexcept
      method AllocateHeap (line 508) | void AllocateHeap() noexcept(false)
    type SStreamOutputSuffix (line 531) | struct SStreamOutputSuffix
    type EDirtyBits (line 545) | enum EDirtyBits : UINT64
    class ImmediateContext (line 649) | class ImmediateContext
      class CDisablePredication (line 895) | class CDisablePredication
      class CreationArgs (line 908) | class CreationArgs
        method CreationArgs (line 911) | CreationArgs()
      method UINT64 (line 937) | UINT64 DebugFlags() { return m_DebugFlags; }
      method RequiresBufferOutofBoundsHandling (line 941) | bool RequiresBufferOutofBoundsHandling() { return m_CreationArgs.Req...
      method IsXbox (line 942) | bool IsXbox() { return m_CreationArgs.IsXbox; }
      type UpdateSubresourcesFlags (line 1000) | enum class UpdateSubresourcesFlags
      type PreparedUpdateSubresourcesOperation (line 1018) | struct PreparedUpdateSubresourcesOperation
      type PreparedUpdateSubresourcesOperationWithLocalPlacement (line 1031) | struct PreparedUpdateSubresourcesOperationWithLocalPlacement
      class CPrepareUpdateSubresourcesHelper (line 1037) | class CPrepareUpdateSubresourcesHelper
      method CreatesAndDestroysAreMultithreaded (line 1090) | bool CreatesAndDestroysAreMultithreaded() const noexcept { return m_...
      method ResourceCache (line 1118) | ResourceCache &GetResourceCache() { return m_ResourceCache; }
      type TILE_MAPPING_FLAG (line 1219) | enum TILE_MAPPING_FLAG
      type TILE_RANGE_FLAG (line 1224) | enum TILE_RANGE_FLAG
      type TILE_COPY_FLAG (line 1231) | enum TILE_COPY_FLAG
      method TryAllocateResourceWithFallback (line 1293) | auto TryAllocateResourceWithFallback(TFunc&& allocateFunc, ResourceA...
      type SStageState (line 1315) | struct SStageState
        method SStageState (line 1317) | SStageState() noexcept(false) = default;
      type SState (line 1336) | struct SState
        method SState (line 1338) | SState() noexcept(false) = default;
      class BltResolveManager (line 1368) | class BltResolveManager
      method UINT (line 1453) | UINT GetNodeMask() const noexcept
      method UINT (line 1458) | UINT GetNodeIndex() const noexcept
      method D3D12_HEAP_PROPERTIES (line 1463) | D3D12_HEAP_PROPERTIES GetHeapProperties(D3D12_HEAP_TYPE Type) const ...
      method D3D12_FEATURE_DATA_D3D12_OPTIONS (line 1475) | const D3D12_FEATURE_DATA_D3D12_OPTIONS& GetCaps() { return m_caps; }
      method ComputeOnly (line 1476) | bool ComputeOnly() const {return !!(FeatureLevel() == D3D_FEATURE_LE...
      type OnlineDescriptorHeap (line 1498) | struct OnlineDescriptorHeap
        method D3D12_CPU_DESCRIPTOR_HANDLE (line 1513) | inline D3D12_CPU_DESCRIPTOR_HANDLE CPUHandle(UINT slot) {
        method D3D12_GPU_DESCRIPTOR_HANDLE (line 1517) | inline D3D12_GPU_DESCRIPTOR_HANDLE GPUHandle(UINT slot) {
      type GenerateMipsRootSignatureSlots (line 1552) | enum GenerateMipsRootSignatureSlots
      method CDescriptorHeapManager (line 1565) | CDescriptorHeapManager& GetViewAllocator<ShaderResourceViewType>() {...
      method CDescriptorHeapManager (line 1566) | CDescriptorHeapManager& GetViewAllocator<UnorderedAccessViewType>() ...
      method CDescriptorHeapManager (line 1567) | CDescriptorHeapManager& GetViewAllocator<RenderTargetViewType>() { r...
      method CDescriptorHeapManager (line 1568) | CDescriptorHeapManager& GetViewAllocator<DepthStencilViewType>() { r...
      method D3D_FEATURE_LEVEL (line 1581) | D3D_FEATURE_LEVEL FeatureLevel() const { return m_FeatureLevel; }
      method UseRoundTripPSOs (line 1585) | bool UseRoundTripPSOs()
      method TranslationLayerCallbacks (line 1590) | TranslationLayerCallbacks const& GetUpperlayerCallbacks() { return m...
      method ResidencyManager (line 1592) | ResidencyManager &GetResidencyManager() { return m_residencyManager; }
      method ResourceStateManager (line 1593) | ResourceStateManager& GetResourceStateManager() { return m_ResourceS...
      method TDynamicBufferPool (line 1609) | TDynamicBufferPool& GetBufferPool(AllocatorHeapType HeapType)
      method ResourceNeedsOwnAllocation (line 1629) | static bool ResourceNeedsOwnAllocation(UINT64 size, bool cannotBeOff...
      method ConditionalHeapAllocator (line 1640) | ConditionalHeapAllocator& GetAllocator(AllocatorHeapType HeapType)
      method IsSingleCommandListType (line 1672) | static inline bool IsSingleCommandListType(UINT commandListTypeMask)
      method BYTE (line 1692) | BYTE* GetBuffer(UINT minSize)
      method D3D12_FEATURE_DATA_D3D12_OPTIONS13 (line 1725) | const D3D12_FEATURE_DATA_D3D12_OPTIONS13& GetOptions13() const { ret...
    type RetiredObject (line 651) | struct RetiredObject
      method RetiredObject (line 653) | RetiredObject() {}
      method RetiredObject (line 654) | RetiredObject(COMMAND_LIST_TYPE CommandListType, UINT64 lastCommandL...
      method RetiredObject (line 661) | RetiredObject(const UINT64 lastCommandListIDs[(UINT)COMMAND_LIST_TYP...
      method ReadyToDestroy (line 674) | bool ReadyToDestroy(ImmediateContext* pContext) { return ReadyToDest...
    type RetiredD3D12Object (line 681) | struct RetiredD3D12Object : public RetiredObject
      method RetiredD3D12Object (line 683) | RetiredD3D12Object() {}
      method RetiredD3D12Object (line 684) | RetiredD3D12Object(ID3D12Object* pUnderlying, _In_opt_ std::unique_p...
      method RetiredD3D12Object (line 689) | RetiredD3D12Object(ID3D12Object* pUnderlying, _In_opt_ std::unique_p...
      method RetiredD3D12Object (line 694) | RetiredD3D12Object(RetiredD3D12Object &&retiredObject) :
    type RetiredSuballocationBlock (line 707) | struct RetiredSuballocationBlock : public RetiredObject
      method RetiredSuballocationBlock (line 709) | RetiredSuballocationBlock(HeapSuballocationBlock &block, Conditional...
      method RetiredSuballocationBlock (line 714) | RetiredSuballocationBlock(HeapSuballocationBlock &block, Conditional...
      method Destroy (line 719) | void Destroy()
    class DeferredDeletionQueueManager (line 728) | class DeferredDeletionQueueManager
      method DeferredDeletionQueueManager (line 731) | DeferredDeletionQueueManager(ImmediateContext *pContext)
      method AddObjectToQueue (line 743) | void AddObjectToQueue(ID3D12Object* pUnderlying, std::unique_ptr<Res...
      method AddObjectToQueue (line 748) | void AddObjectToQueue(ID3D12Object* pUnderlying, std::unique_ptr<Res...
      method AddSuballocationToQueue (line 753) | void AddSuballocationToQueue(HeapSuballocationBlock &suballocation, ...
      method AddSuballocationToQueue (line 766) | void AddSuballocationToQueue(HeapSuballocationBlock &suballocation, ...
    class COptLockedContainer (line 787) | class COptLockedContainer
      class LockedAccess (line 792) | class LockedAccess
        method LockedAccess (line 797) | LockedAccess(OptLock<mutex_t> &CS, T& Obj)
        method T (line 800) | T* operator->() { return &m_Obj; }
      method COptLockedContainer (line 804) | COptLockedContainer(Args&&... args) : m_Obj(std::forward<Args>(args)...
      method LockedAccess (line 805) | LockedAccess GetLocked() { return LockedAccess(m_CS, m_Obj); }
        method LockedAccess (line 797) | LockedAccess(OptLock<mutex_t> &CS, T& Obj)
        method T (line 800) | T* operator->() { return &m_Obj; }
      method InitLock (line 806) | void InitLock() { m_CS.EnsureLock(); }
    type ResourceInfoType (line 809) | enum ResourceInfoType
    type ResourceInfo (line 815) | struct ResourceInfo
    type PresentSurface (line 841) | struct PresentSurface
      method PresentSurface (line 843) | PresentSurface() : m_pResource(nullptr), m_subresource(0) {}
      method PresentSurface (line 844) | PresentSurface(Resource* pResource, UINT subresource = 0) : m_pResou...
    type PresentCBArgs (line 850) | struct PresentCBArgs
    class ImmediateContext (line 862) | class ImmediateContext
      class CDisablePredication (line 895) | class CDisablePredication
      class CreationArgs (line 908) | class CreationArgs
        method CreationArgs (line 911) | CreationArgs()
      method UINT64 (line 937) | UINT64 DebugFlags() { return m_DebugFlags; }
      method RequiresBufferOutofBoundsHandling (line 941) | bool RequiresBufferOutofBoundsHandling() { return m_CreationArgs.Req...
      method IsXbox (line 942) | bool IsXbox() { return m_CreationArgs.IsXbox; }
      type UpdateSubresourcesFlags (line 1000) | enum class UpdateSubresourcesFlags
      type PreparedUpdateSubresourcesOperation (line 1018) | struct PreparedUpdateSubresourcesOperation
      type PreparedUpdateSubresourcesOperationWithLocalPlacement (line 1031) | struct PreparedUpdateSubresourcesOperationWithLocalPlacement
      class CPrepareUpdateSubresourcesHelper (line 1037) | class CPrepareUpdateSubresourcesHelper
      method CreatesAndDestroysAreMultithreaded (line 1090) | bool CreatesAndDestroysAreMultithreaded() const noexcept { return m_...
      method ResourceCache (line 1118) | ResourceCache &GetResourceCache() { return m_ResourceCache; }
      type TILE_MAPPING_FLAG (line 1219) | enum TILE_MAPPING_FLAG
      type TILE_RANGE_FLAG (line 1224) | enum TILE_RANGE_FLAG
      type TILE_COPY_FLAG (line 1231) | enum TILE_COPY_FLAG
      method TryAllocateResourceWithFallback (line 1293) | auto TryAllocateResourceWithFallback(TFunc&& allocateFunc, ResourceA...
      type SStageState (line 1315) | struct SStageState
        method SStageState (line 1317) | SStageState() noexcept(false) = default;
      type SState (line 1336) | struct SState
        method SState (line 1338) | SState() noexcept(false) = default;
      class BltResolveManager (line 1368) | class BltResolveManager
      method UINT (line 1453) | UINT GetNodeMask() const noexcept
      method UINT (line 1458) | UINT GetNodeIndex() const noexcept
      method D3D12_HEAP_PROPERTIES (line 1463) | D3D12_HEAP_PROPERTIES GetHeapProperties(D3D12_HEAP_TYPE Type) const ...
      method D3D12_FEATURE_DATA_D3D12_OPTIONS (line 1475) | const D3D12_FEATURE_DATA_D3D12_OPTIONS& GetCaps() { return m_caps; }
      method ComputeOnly (line 1476) | bool ComputeOnly() const {return !!(FeatureLevel() == D3D_FEATURE_LE...
      type OnlineDescriptorHeap (line 1498) | struct OnlineDescriptorHeap
        method D3D12_CPU_DESCRIPTOR_HANDLE (line 1513) | inline D3D12_CPU_DESCRIPTOR_HANDLE CPUHandle(UINT slot) {
        method D3D12_GPU_DESCRIPTOR_HANDLE (line 1517) | inline D3D12_GPU_DESCRIPTOR_HANDLE GPUHandle(UINT slot) {
      type GenerateMipsRootSignatureSlots (line 1552) | enum GenerateMipsRootSignatureSlots
      method CDescriptorHeapManager (line 1565) | CDescriptorHeapManager& GetViewAllocator<ShaderResourceViewType>() {...
      method CDescriptorHeapManager (line 1566) | CDescriptorHeapManager& GetViewAllocator<UnorderedAccessViewType>() ...
      method CDescriptorHeapManager (line 1567) | CDescriptorHeapManager& GetViewAllocator<RenderTargetViewType>() { r...
      method CDescriptorHeapManager (line 1568) | CDescriptorHeapManager& GetViewAllocator<DepthStencilViewType>() { r...
      method D3D_FEATURE_LEVEL (line 1581) | D3D_FEATURE_LEVEL FeatureLevel() const { return m_FeatureLevel; }
      method UseRoundTripPSOs (line 1585) | bool UseRoundTripPSOs()
      method TranslationLayerCallbacks (line 1590) | TranslationLayerCallbacks const& GetUpperlayerCallbacks() { return m...
      method ResidencyManager (line 1592) | ResidencyManager &GetResidencyManager() { return m_residencyManager; }
      method ResourceStateManager (line 1593) | ResourceStateManager& GetResourceStateManager() { return m_ResourceS...
      method TDynamicBufferPool (line 1609) | TDynamicBufferPool& GetBufferPool(AllocatorHeapType HeapType)
      method ResourceNeedsOwnAllocation (line 1629) | static bool ResourceNeedsOwnAllocation(UINT64 size, bool cannotBeOff...
      method ConditionalHeapAllocator (line 1640) | ConditionalHeapAllocator& GetAllocator(AllocatorHeapType HeapType)
      method IsSingleCommandListType (line 1672) | static inline bool IsSingleCommandListType(UINT commandListTypeMask)
      method BYTE (line 1692) | BYTE* GetBuffer(UINT minSize)
      method D3D12_FEATURE_DATA_D3D12_OPTIONS13 (line 1725) | const D3D12_FEATURE_DATA_D3D12_OPTIONS13& GetOptions13() const { ret...
    type SafeRenameResourceCookie (line 1735) | struct SafeRenameResourceCookie
      method SafeRenameResourceCookie (line 1737) | SafeRenameResourceCookie(Resource* c = nullptr) : m_c(c) { }
      method Resource (line 1738) | Resource* Detach() { auto c = m_c; m_c = nullptr; return c; }
      method Resource (line 1739) | Resource* Get() { return m_c; }
      method Delete (line 1740) | void Delete()
      method Reset (line 1748) | void Reset(Resource* c) { Delete(); m_c = c; }

FILE: include/MaxFrameLatencyHelper.hpp
  type D3D12TranslationLayer (line 3) | namespace D3D12TranslationLayer
    class MaxFrameLatencyHelper (line 5) | class MaxFrameLatencyHelper

FILE: include/PipelineState.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class RootSignature (line 7) | class RootSignature
    type EPipelineType (line 8) | enum EPipelineType
    type GRAPHICS_PIPELINE_STATE_DESC (line 14) | struct GRAPHICS_PIPELINE_STATE_DESC
    type COMPUTE_PIPELINE_STATE_DESC (line 63) | struct COMPUTE_PIPELINE_STATE_DESC
    type PipelineState (line 77) | struct PipelineState : protected DeviceChildImpl<ID3D12PipelineState>
      method EPipelineType (line 80) | EPipelineType GetPipelineStateType() { return m_PipelineStateType; }
      method D3D12_GRAPHICS_PIPELINE_STATE_DESC (line 82) | const D3D12_GRAPHICS_PIPELINE_STATE_DESC &GetGraphicsDesc()
      method D3D12_COMPUTE_PIPELINE_STATE_DESC (line 88) | const D3D12_COMPUTE_PIPELINE_STATE_DESC &GetComputeDesc()
      method SShaderDecls (line 95) | SShaderDecls *GetShader() {
      method RootSignature (line 115) | RootSignature* GetRootSignature() { return m_pRootSignature; }
      method ID3D12PipelineState (line 121) | ID3D12PipelineState* GetForUse(COMMAND_LIST_TYPE CommandListType)
      type Graphics (line 135) | struct Graphics
      type Compute (line 145) | struct Compute

FILE: include/Query.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class ConditionalAutoTransition (line 7) | class ConditionalAutoTransition
      method ConditionalAutoTransition (line 10) | ConditionalAutoTransition() : m_pCommandList(nullptr), m_pResource(n...
    class AutoTransition (line 22) | class AutoTransition : public ConditionalAutoTransition
      method AutoTransition (line 25) | AutoTransition(ID3D12GraphicsCommandList* pCommandList, ID3D12Resour...
    type EQueryType (line 37) | enum EQueryType
    class Async (line 76) | class Async : public DeviceChild
      type AsyncState (line 79) | enum class AsyncState { Begun, Ended }
    class Query (line 112) | class Query : public Async
      method Query (line 115) | Query(ImmediateContext* pDevice, EQueryType Type, UINT CommandListTy...
      method ID3D12Resource (line 128) | ID3D12Resource *GetPredicationBuffer() { return m_spPredicationBuffe...
      method UINT (line 130) | UINT GetCurrentInstance() { return m_CurrentInstance;  }
    class EventQuery (line 155) | class EventQuery : public Async
      method EventQuery (line 158) | EventQuery(ImmediateContext* pDevice, UINT CommandListTypeMask) noex...
    type QUERY_DATA_TIMESTAMP_DISJOINT (line 171) | struct QUERY_DATA_TIMESTAMP_DISJOINT
    class TimestampDisjointQuery (line 177) | class TimestampDisjointQuery : public Async
      method TimestampDisjointQuery (line 180) | TimestampDisjointQuery(ImmediateContext* pDevice, UINT CommandListTy...

FILE: include/Residency.h
  function namespace (line 5) | namespace D3D12TranslationLayer

FILE: include/Resource.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type RESOURCE_USAGE (line 9) | enum RESOURCE_USAGE
    type RESOURCE_CPU_ACCESS (line 17) | enum RESOURCE_CPU_ACCESS
    type RESOURCE_BIND_FLAGS (line 25) | enum RESOURCE_BIND_FLAGS
    type MAP_TYPE (line 44) | enum MAP_TYPE
    type DeferredDestructionType (line 53) | enum class DeferredDestructionType
    type MappedSubresource (line 59) | struct MappedSubresource
    type AppResourceDesc (line 68) | struct AppResourceDesc
      method AppResourceDesc (line 70) | AppResourceDesc() { memset(this, 0, sizeof(*this)); }
      method AppResourceDesc (line 72) | AppResourceDesc(UINT SubresourcesPerPlane,
      method UINT (line 108) | UINT SubresourcesPerPlane() const { return m_SubresourcesPerPlane; }
      method UINT8 (line 109) | UINT8 NonOpaquePlaneCount() const { return m_NonOpaquePlaneCount; }
      method UINT (line 110) | UINT Subresources() const { return m_Subresources; }
      method UINT8 (line 111) | UINT8 MipLevels() const { return m_MipLevels; }
      method UINT16 (line 112) | UINT16 ArraySize() const { return m_ArraySize; }
      method UINT (line 113) | UINT Depth() const { return m_Depth; }
      method UINT (line 114) | UINT Width() const { return m_Width; }
      method UINT (line 115) | UINT Height() const { return m_Height; }
      method DXGI_FORMAT (line 116) | DXGI_FORMAT Format() const { return m_Format; }
      method UINT (line 117) | UINT Samples() const { return m_Samples; }
      method UINT (line 118) | UINT Quality() const { return m_Quality; }
      method RESOURCE_CPU_ACCESS (line 119) | RESOURCE_CPU_ACCESS CPUAccessFlags() const { return m_cpuAcess; }
      method RESOURCE_USAGE (line 120) | RESOURCE_USAGE Usage() const { return m_usage; }
      method RESOURCE_BIND_FLAGS (line 121) | RESOURCE_BIND_FLAGS BindFlags() const { return m_bindFlags; }
      method D3D12_RESOURCE_DIMENSION (line 122) | D3D12_RESOURCE_DIMENSION ResourceDimension() const { return m_resour...
    type FormatEmulation (line 141) | enum class FormatEmulation
    type ResourceCreationArgs (line 148) | struct ResourceCreationArgs
      method D3D12_RESOURCE_DIMENSION (line 150) | D3D12_RESOURCE_DIMENSION ResourceDimension12() const { return m_desc...
      method D3D12_TEXTURE_LAYOUT (line 151) | D3D12_TEXTURE_LAYOUT ApiTextureLayout12() const { return m_desc12.La...
      method D3D11_RESOURCE_DIMENSION (line 153) | D3D11_RESOURCE_DIMENSION ResourceDimension11() const
      method UINT (line 158) | UINT ArraySize() const
      method IsShared (line 163) | bool IsShared() const
      method IsNTHandleShared (line 167) | bool IsNTHandleShared() const
      method IsGDIStyleHandleShared (line 171) | bool IsGDIStyleHandleShared() const
    type ResidencyManagedObjectWrapper (line 204) | struct ResidencyManagedObjectWrapper
      method ResidencyManagedObjectWrapper (line 206) | ResidencyManagedObjectWrapper(ResidencyManager &residencyManager) : ...
      method ResidencyManagedObjectWrapper (line 209) | ResidencyManagedObjectWrapper(const ResidencyManagedObjectWrapper&) ...
      method Initialize (line 211) | void Initialize(ID3D12Pageable *pResource, UINT64 resourceSize, bool...
      method ManagedObject (line 225) | ManagedObject &GetManagedObject() { return m_residencyHandle; }
    function D3D12ResourceSuballocation (line 236) | D3D12ResourceSuballocation() { Reset(); }
    function D3D12ResourceSuballocation (line 237) | D3D12ResourceSuballocation(ID3D12Resource *pResource, const HeapSuball...
    function IsInitialized (line 240) | bool IsInitialized() { return GetResource() != nullptr; }
    function Reset (line 241) | void Reset() { m_pResource = nullptr; }
    function ID3D12Resource (line 242) | ID3D12Resource *GetResource() const { return m_pResource; }
    function UINT64 (line 243) | UINT64 GetOffset() const {
    function Unmap (line 284) | void Unmap(
    function D3D12_TEXTURE_COPY_LOCATION (line 299) | D3D12_TEXTURE_COPY_LOCATION GetCopyLocation(const D3D12_PLACED_SUBRESO...
    function HeapSuballocationBlock (line 306) | HeapSuballocationBlock const& GetBufferSuballocation() const
    function HeapSuballocationBlock (line 310) | HeapSuballocationBlock &GetBufferSuballocation()
    function D3D12_RANGE (line 315) | inline D3D12_RANGE OffsetRange(const D3D12_RANGE &originalRange) const
  type EncodedResourceSuballocation (line 333) | struct EncodedResourceSuballocation
    method UINT (line 340) | static UINT GetDirectAllocationMask(HeapSuballocationBlock const& block)
    method EncodedResourceSuballocation (line 346) | EncodedResourceSuballocation() = default;
    method EncodedResourceSuballocation (line 347) | EncodedResourceSuballocation(HeapSuballocationBlock const& block, ID3D...
    method EncodedResourceSuballocation (line 353) | EncodedResourceSuballocation(D3D12ResourceSuballocation const& suballoc)
    method IsDirectAllocation (line 357) | bool IsDirectAllocation() const { return (Ptr & c_DirectAllocationMask...
    method ID3D12Resource (line 358) | ID3D12Resource* GetResource() const { return reinterpret_cast<ID3D12Re...
    method ID3D12Resource (line 359) | ID3D12Resource* GetDirectAllocation() const { return IsDirectAllocatio...
    method HeapSuballocationBlock (line 360) | HeapSuballocationBlock DecodeSuballocation() const { return HeapSuball...
    method D3D12ResourceSuballocation (line 361) | D3D12ResourceSuballocation Decode() const { return D3D12ResourceSuball...
  type OutstandingResourceUse (line 364) | struct OutstandingResourceUse
    method OutstandingResourceUse (line 366) | OutstandingResourceUse(COMMAND_LIST_TYPE type, UINT64 value)
  class Resource (line 385) | class Resource : public DeviceChild,
    method AddRef (line 412) | inline void AddRef() { InterlockedIncrement(&m_RefCount); }
    method Release (line 413) | inline void Release() { if (InterlockedDecrement(&m_RefCount) == 0) { ...
    method ResourceCreationArgs (line 417) | ResourceCreationArgs* Parent() { return &m_creationArgs; }
    method AppResourceDesc (line 418) | AppResourceDesc* AppDesc() { return &m_creationArgs.m_appDesc; }
    method ID3D12Resource (line 420) | ID3D12Resource* GetUnderlyingResource() noexcept { return m_Identity->...
    method UINT (line 424) | UINT NumSubresources() noexcept { return AppDesc()->Subresources() * m...
    method UINT8 (line 425) | UINT8 SubresourceMultiplier() noexcept { return m_SubresourceMultiplie...
    method UINT (line 426) | UINT GetExtendedSubresourceIndex(UINT Index, UINT Plane) noexcept
    method CSubresourceSubset (line 431) | CSubresourceSubset GetFullSubresourceSubset() { return CSubresourceSub...
    method DecomposeSubresource (line 433) | void DecomposeSubresource(_In_ UINT Subresource, _Out_ UINT &mipSlice,...
    method UINT (line 438) | UINT GetSubresourceIndex(UINT PlaneIndex, UINT MipLevel, UINT ArraySli...
    method UINT (line 450) | UINT GetUniqueness() const noexcept { return m_AllUniqueness; }
    method UINT (line 451) | UINT GetUniqueness<ShaderResourceViewType>() const noexcept { return m...
    method ViewBound (line 453) | void ViewBound(View<TViewIface>* pView, EShaderStage stage, UINT slot)...
    method ViewUnbound (line 454) | void ViewUnbound(View<TViewIface>* pView, EShaderStage stage, UINT slo...
    method UINT (line 456) | inline UINT GetOffsetToStreamOutputSuffix() { return m_OffsetToStreamO...
    method RESOURCE_USAGE (line 457) | RESOURCE_USAGE GetEffectiveUsage() const { return m_effectiveUsage; }
    method IsBloatedConstantBuffer (line 458) | inline bool IsBloatedConstantBuffer() { return (AppDesc()->BindFlags()...
    method IsDefaultResourceBloated (line 459) | inline bool IsDefaultResourceBloated() { return m_OffsetToStreamOutput...
    method TriggersDeferredWaits (line 460) | inline bool TriggersDeferredWaits() const { return m_creationArgs.m_bT...
    method FormatEmulation (line 461) | inline FormatEmulation GetFormatEmulation() const { return m_creationA...
    method IsInplaceFormatEmulation (line 462) | inline bool IsInplaceFormatEmulation() const { return GetFormatEmulati...
    method AddHeapToTilePool (line 466) | void AddHeapToTilePool(unique_comptr<ID3D12Heap> spHeap)
    method SetMinLOD (line 474) | inline void SetMinLOD(float MinLOD) { m_MinLOD = MinLOD; }
    method GetMinLOD (line 475) | inline float GetMinLOD() { return m_MinLOD; }
    method SetWaitForCompletionRequired (line 477) | inline void SetWaitForCompletionRequired(bool value) { m_bWaitForCompl...
    method UINT (line 481) | UINT GetCommandListTypeMaskFromUsed()
    method UINT (line 494) | UINT GetCommandListTypeMask()
    method UINT (line 504) | UINT GetCommandListTypeMask(const CViewSubresourceSubset &viewSubresou...
    method UINT (line 514) | UINT GetCommandListTypeMask(UINT Subresource)
    method SwapIdentities (line 530) | void SwapIdentities(Resource& Other)
    method IsResident (line 539) | bool IsResident()
    method IsSuballocatedFromSameHeap (line 545) | static bool IsSuballocatedFromSameHeap(Resource *pResourceA, Resource ...
    method IsSameUnderlyingSubresource (line 551) | static bool IsSameUnderlyingSubresource(Resource *pResourceA, UINT sub...
    method AllocatorHeapType (line 557) | AllocatorHeapType GetAllocatorHeapType()
    method UnderlyingResourceIsSuballocated (line 578) | bool UnderlyingResourceIsSuballocated()
    method IsLockableSharedBuffer (line 583) | bool IsLockableSharedBuffer()
    method IsDecoderCompressedBuffer (line 588) | bool IsDecoderCompressedBuffer()
    method OwnsReadbackHeap (line 593) | bool OwnsReadbackHeap()
    type SResourceIdentity (line 620) | struct SResourceIdentity
      method SResourceIdentity (line 622) | SResourceIdentity(UINT NumSubresources, bool bSimultaneousAccess, vo...
      method ID3D12Resource (line 630) | ID3D12Resource *GetOwnedResource()
      method ID3D12Resource (line 636) | ID3D12Resource *GetSuballocatedResource()
      method UINT64 (line 642) | UINT64 GetSuballocatedOffset()
      method ID3D12Resource (line 648) | ID3D12Resource *GetResource()
      method HasRestrictedOutstandingResources (line 669) | bool HasRestrictedOutstandingResources()
    method AllocateResourceIdentity (line 678) | std::unique_ptr<SResourceIdentity> AllocateResourceIdentity(UINT NumSu...
    method SResourceIdentity (line 696) | SResourceIdentity* GetIdentity() { return m_Identity.get(); }
      method SResourceIdentity (line 622) | SResourceIdentity(UINT NumSubresources, bool bSimultaneousAccess, vo...
      method ID3D12Resource (line 630) | ID3D12Resource *GetOwnedResource()
      method ID3D12Resource (line 636) | ID3D12Resource *GetSuballocatedResource()
      method UINT64 (line 642) | UINT64 GetSuballocatedOffset()
      method ID3D12Resource (line 648) | ID3D12Resource *GetResource()
      method HasRestrictedOutstandingResources (line 669) | bool HasRestrictedOutstandingResources()
    method CResourceBindings (line 697) | CResourceBindings& GetBindingState() { return m_currentBindings; }
    method UnbindList (line 702) | void UnbindList(LIST_ENTRY list, UnbindFunction& unbindFunction)
    type STilePoolAllocation (line 740) | struct STilePoolAllocation
      method STilePoolAllocation (line 749) | STilePoolAllocation(UINT size, UINT offset) : m_Size(size), m_TileOf...
      method STilePoolAllocation (line 750) | STilePoolAllocation() : m_Size(0), m_TileOffset(0) { }
      method STilePoolAllocation (line 751) | STilePoolAllocation(STilePoolAllocation&& other)
    type STilePoolData (line 758) | struct STilePoolData
    type STiledResourceData (line 762) | struct STiledResourceData
      method STiledResourceData (line 764) | STiledResourceData(UINT NumSubresources, void*& pPreallocatedMemory)
    type EmulatedFormatMapState (line 776) | enum class EmulatedFormatMapState { Write, ReadWrite, Read, None }
    type SEmulatedFormatSubresourceStagingAllocation (line 778) | struct SEmulatedFormatSubresourceStagingAllocation
      type Deallocator (line 780) | struct Deallocator
    type SEmulatedFormatSubresourceStagingData (line 787) | struct SEmulatedFormatSubresourceStagingData
    method UINT (line 813) | UINT GetDynamicTextureIndex(UINT Subresource)
    method SetLastCopyCommandListID (line 827) | void SetLastCopyCommandListID(UINT subresource, UINT64 commandListID)
    method UINT64 (line 833) | UINT64 GetLastCopyCommandListID(UINT subresource)
    type CpuHeapData (line 839) | struct CpuHeapData
    type DynamicTexturePlaneData (line 883) | struct DynamicTexturePlaneData
      method AnyPlaneMapped (line 888) | bool AnyPlaneMapped() const { return (*reinterpret_cast<const UINT32...
    method DynamicTexturePlaneData (line 892) | DynamicTexturePlaneData &GetDynamicTextureData(UINT subresource)
      method AnyPlaneMapped (line 888) | bool AnyPlaneMapped() const { return (*reinterpret_cast<const UINT32...

FILE: include/ResourceBinding.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class CSubresourceBindings (line 13) | class CSubresourceBindings
      method CSubresourceBindings (line 18) | CSubresourceBindings()
      method IsBoundAsPixelShaderResource (line 22) | bool IsBoundAsPixelShaderResource() const { return m_PSSRVBindRefs !...
      method IsBoundAsNonPixelShaderResource (line 23) | bool IsBoundAsNonPixelShaderResource() const { return m_NonPSSRVBind...
      method IsBoundAsUnorderedAccess (line 24) | bool IsBoundAsUnorderedAccess() const { return m_UAVBindRefs != 0; }
      method IsBoundAsRenderTarget (line 25) | bool IsBoundAsRenderTarget() const { return m_RTVBindRefs != 0; }
      method IsBoundAsWritableDepth (line 26) | bool IsBoundAsWritableDepth() const { return m_bIsDepthOrStencilBoun...
      method IsBoundAsReadOnlyDepth (line 27) | bool IsBoundAsReadOnlyDepth() const { return m_bIsDepthOrStencilBoun...
      method PixelShaderResourceViewBound (line 29) | void PixelShaderResourceViewBound() { ++m_PSSRVBindRefs; }
      method NonPixelShaderResourceViewBound (line 30) | void NonPixelShaderResourceViewBound() { ++m_NonPSSRVBindRefs; }
      method UnorderedAccessViewBound (line 31) | void UnorderedAccessViewBound() { ++m_UAVBindRefs; }
      method RenderTargetViewBound (line 32) | void RenderTargetViewBound() { ++m_RTVBindRefs; }
      method ReadOnlyDepthStencilViewBound (line 33) | void ReadOnlyDepthStencilViewBound() { m_bIsDepthOrStencilBoundForRe...
      method WritableDepthStencilViewBound (line 34) | void WritableDepthStencilViewBound() { m_bIsDepthOrStencilBoundForWr...
      method PixelShaderResourceViewUnbound (line 36) | void PixelShaderResourceViewUnbound() { --m_PSSRVBindRefs; }
      method NonPixelShaderResourceViewUnbound (line 37) | void NonPixelShaderResourceViewUnbound() { --m_NonPSSRVBindRefs; }
      method UnorderedAccessViewUnbound (line 38) | void UnorderedAccessViewUnbound() { --m_UAVBindRefs; }
      method RenderTargetViewUnbound (line 39) | void RenderTargetViewUnbound() { --m_RTVBindRefs; }
      method DepthStencilViewUnbound (line 40) | void DepthStencilViewUnbound()
    class View (line 64) | class View
    class CResourceBindings (line 66) | class CResourceBindings
      method IsBoundAsShaderResource (line 72) | bool IsBoundAsShaderResource() const { return !D3D12TranslationLayer...
      method IsBoundAsRenderTarget (line 73) | bool IsBoundAsRenderTarget() const { return !D3D12TranslationLayer::...
      method IsBoundAsUnorderedAccess (line 74) | bool IsBoundAsUnorderedAccess() const { return !D3D12TranslationLaye...
      method IsBoundAsDepthStencil (line 75) | bool IsBoundAsDepthStencil() const { return m_bIsDepthStencilViewBou...
      method IsBoundAsConstantBuffer (line 76) | bool IsBoundAsConstantBuffer() const { return m_ConstantBufferBindRe...
      method IsBoundAsIndexBuffer (line 77) | bool IsBoundAsIndexBuffer() const { return m_bIsIndexBufferBound; }
      method IsBoundAsVertexBuffer (line 78) | bool IsBoundAsVertexBuffer() const { return m_VertexBufferBindings !...
      method IsBoundAsStreamOut (line 79) | bool IsBoundAsStreamOut() const { return m_StreamOutBindings != 0; }
      method AreAllSubresourcesTheSame (line 100) | bool AreAllSubresourcesTheSame() const { return m_NumViewsReferencin...
      method LIST_ENTRY (line 104) | LIST_ENTRY& GetRenderTargetList() { return m_RenderTargetViewList; }
      method LIST_ENTRY (line 105) | LIST_ENTRY& GetShaderResourceList() { return m_ShaderResourceViewLis...
      method UINT (line 106) | UINT& GetVertexBufferBindings() { return m_VertexBufferBindings; }
      method CalcPreallocationSize (line 108) | static size_t CalcPreallocationSize(UINT SubresourceCount) { return ...
    type VBBinder (line 128) | struct VBBinder
    type IBBinder (line 133) | struct IBBinder
    type SOBinder (line 138) | struct SOBinder
    class CBoundState (line 151) | class CBoundState
      method CBoundState (line 157) | CBoundState() = default;
      method UINT (line 160) | UINT slot) noexcept { m_DirtyBits.set(slot); }
      method SetDirtyBits (line 161) | void SetDirtyBits(std::bitset<NumBindSlots> const& bits) noexcept { ...
      method TBindable (line 163) | TBindable* const* GetBound() const noexcept { return m_Bound; }
      method ResetDirty (line 164) | void ResetDirty(UINT slot) noexcept { m_DirtyBits.set(slot, false); }
      method UINT (line 166) | UINT GetNumBound() const noexcept { return m_NumBound; }
      method TBindable (line 169) | TBindable* pBindable) noexcept
      method Clear (line 189) | void Clear()
      method TrimNumBound (line 198) | void TrimNumBound()
    class CSimpleBoundState (line 215) | class CSimpleBoundState : public CBoundState<TBindable, NumBindSlots>
      method CSimpleBoundState (line 218) | CSimpleBoundState() = default;
      method IsDirty (line 221) | bool IsDirty() const
      method ResetDirty (line 225) | void ResetDirty()
      method Clear (line 230) | void Clear(EShaderStage shader)
    class CViewBoundState (line 242) | class CViewBoundState : public CBoundState<TBindable, NumBindSlots>
      method CViewBoundState (line 250) | CViewBoundState() noexcept(false)
      method noexcept (line 259) | const noexcept
      method UINT (line 268) | UINT RootSignatureHWM) noexcept
      method Clear (line 284) | void Clear(EShaderStage shader)
    class CConstantBufferBoundState (line 297) | class CConstantBufferBoundState : public CBoundState<Resource, D3D11_C...
      method CConstantBufferBoundState (line 300) | CConstantBufferBoundState() noexcept
      method UINT (line 307) | UINT rootSignatureBucketSize) noexcept
      method Clear (line 315) | void Clear(EShaderStage shader)
    class CSamplerBoundState (line 327) | class CSamplerBoundState : public CBoundState<Sampler, D3D11_COMMONSHA...
      method CSamplerBoundState (line 333) | CSamplerBoundState() noexcept
      method UINT (line 341) | UINT rootSignatureBucketSize) noexcept
      method UINT (line 350) | UINT RootSignatureHWM) noexcept
      method Clear (line 359) | void Clear()

FILE: include/ResourceCache.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type ResourceCacheEntry (line 7) | struct ResourceCacheEntry
    class ResourceCache (line 14) | class ResourceCache

FILE: include/ResourceState.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class CommandListManager (line 7) | class CommandListManager
    type SubresourceTransitionFlags (line 23) | enum class SubresourceTransitionFlags
    function IsD3D12WriteState (line 34) | inline bool IsD3D12WriteState(UINT State, SubresourceTransitionFlags F...
    class CDesiredResourceState (line 44) | class CDesiredResourceState
      type SubresourceInfo (line 47) | struct SubresourceInfo
      method CalcPreallocationSize (line 60) | static size_t CalcPreallocationSize(UINT SubresourceCount) { return ...
      method CDesiredResourceState (line 61) | CDesiredResourceState(UINT SubresourceCount, void*& pPreallocatedMem...
      method AreAllSubresourcesSame (line 66) | bool AreAllSubresourcesSame() const noexcept { return m_bAllSubresou...
    class CCurrentResourceState (line 80) | class CCurrentResourceState
      type ExclusiveState (line 84) | struct ExclusiveState
      type SharedState (line 98) | struct SharedState
      method CalcPreallocationSize (line 116) | static size_t CalcPreallocationSize(UINT SubresourceCount, bool bSim...
      method SupportsSimultaneousAccess (line 122) | bool SupportsSimultaneousAccess() const noexcept { return m_bSimulta...
      method AreAllSubresourcesSame (line 123) | bool AreAllSubresourcesSame() const noexcept { return m_bAllSubresou...
    type DeferredWait (line 144) | struct DeferredWait
    type TransitionableResourceBase (line 154) | struct TransitionableResourceBase
      method CalcPreallocationSize (line 161) | static size_t CalcPreallocationSize(UINT NumSubresources) { return C...
      method TransitionableResourceBase (line 162) | TransitionableResourceBase(UINT NumSubresources, bool bTriggersDefer...
      method IsTransitionPending (line 175) | bool IsTransitionPending() const noexcept { return !D3D12Translation...
      method AddDeferredWaits (line 177) | void AddDeferredWaits(const std::vector<DeferredWait>& DeferredWaits...
    class ResourceStateManagerBase (line 211) | class ResourceStateManagerBase
      type PostApplyExclusiveState (line 221) | enum class PostApplyExclusiveState
      type PostApplyUpdate (line 225) | struct PostApplyUpdate
      type TransitionResult (line 271) | enum class TransitionResult
      method ForEachTransitioningResource (line 283) | void ForEachTransitioningResource(TFunc&& func)
      method if (line 352) | if (update.ExclusiveState == PostApplyExclusiveState::Exclusive ||
      method else (line 377) | else if (update.WasTransitioningToDestinationType)
      method else (line 388) | else
  class ResourceStateManager (line 429) | class ResourceStateManager : public ResourceStateManagerBase
    method ResourceStateManager (line 435) | ResourceStateManager(ImmediateContext& ImmCtx)

FILE: include/RootSignature.hpp
  type D3D12TranslationLayer (line 7) | namespace D3D12TranslationLayer
    type VersionedRootSignatureDescWithStorage (line 11) | struct VersionedRootSignatureDescWithStorage
      method VersionedRootSignatureDescWithStorage (line 21) | VersionedRootSignatureDescWithStorage() = default;
      method VersionedRootSignatureDescWithStorage (line 23) | VersionedRootSignatureDescWithStorage(VersionedRootSignatureDescWith...
      method VersionedRootSignatureDescWithStorage (line 24) | VersionedRootSignatureDescWithStorage(VersionedRootSignatureDescWith...
      method VersionedRootSignatureDescWithStorage (line 25) | VersionedRootSignatureDescWithStorage& operator=(VersionedRootSignat...
      method VersionedRootSignatureDescWithStorage (line 26) | VersionedRootSignatureDescWithStorage& operator=(VersionedRootSignat...
    type RootSignatureDesc (line 29) | struct RootSignatureDesc
      method UINT8 (line 41) | static UINT8 NonCBBindingCountToBucket(UINT BindingCount)
      method UINT8 (line 52) | static UINT8 CBBindingCountToBucket(UINT BindingCount)
      method UINT (line 59) | static constexpr UINT NonCBBucketToBindingCount(UINT8 Bucket)
      method UINT (line 63) | static UINT CBBucketToBindingCount(UINT8 Bucket)
      type ShaderStage (line 69) | struct ShaderStage
        method ShaderStage (line 76) | ShaderStage()
        method ShaderStage (line 83) | ShaderStage(SShaderDecls const* pShader) : ShaderStage()
        method ShaderStage (line 93) | ShaderStage(ShaderStage const&) = default;
        method ShaderStage (line 94) | ShaderStage& operator=(ShaderStage const&) = default;
        method UINT (line 95) | UINT GetCBBindingCount() const { return CBBucketToBindingCount(m_C...
        method UINT (line 96) | UINT GetSamplerBindingCount() const { return NonCBBucketToBindingC...
        method UINT (line 97) | UINT GetSRVBindingCount() const { return NonCBBucketToBindingCount...
        method IsCB14 (line 98) | bool IsCB14() const { return m_CBBucket == 3; }
      type Flags (line 103) | enum Flags : UINT16
      method Flags (line 114) | static Flags ComputeFlags(bool bRequiresBufferOutOfBoundsHandling, s...
      method RootSignatureDesc (line 130) | RootSignatureDesc(SShaderDecls const* pVS, SShaderDecls const* pPS, ...
      method RootSignatureDesc (line 147) | RootSignatureDesc(SShaderDecls const* pCS, bool bRequiresBufferOutOf...
      method RootSignatureDesc (line 155) | RootSignatureDesc(RootSignatureDesc const&) = default;
      method RootSignatureDesc (line 156) | RootSignatureDesc& operator=(RootSignatureDesc const&) = default;
      method UINT (line 158) | UINT GetUAVBindingCount() const { return NonCBBucketToBindingCount(m...
      method UINT64 (line 159) | UINT64 GetAsUINT64() const { return *reinterpret_cast<const UINT64*>...
      method ShaderStage (line 172) | ShaderStage const& GetShaderStage() const
        method ShaderStage (line 76) | ShaderStage()
        method ShaderStage (line 83) | ShaderStage(SShaderDecls const* pShader) : ShaderStage()
        method ShaderStage (line 93) | ShaderStage(ShaderStage const&) = default;
        method ShaderStage (line 94) | ShaderStage& operator=(ShaderStage const&) = default;
        method UINT (line 95) | UINT GetCBBindingCount() const { return CBBucketToBindingCount(m_C...
        method UINT (line 96) | UINT GetSamplerBindingCount() const { return NonCBBucketToBindingC...
        method UINT (line 97) | UINT GetSRVBindingCount() const { return NonCBBucketToBindingCount...
        method IsCB14 (line 98) | bool IsCB14() const { return m_CBBucket == 3; }
      method UINT (line 186) | static UINT NumUAVBindings(SShaderDecls const* pVS, SShaderDecls con...
    class RootSignatureBase (line 203) | class RootSignatureBase : protected DeviceChildImpl<ID3D12RootSignature>
      method RootSignatureBase (line 206) | RootSignatureBase(ImmediateContext* pParent)
    class InternalRootSignature (line 216) | class InternalRootSignature : public RootSignatureBase
      method InternalRootSignature (line 219) | InternalRootSignature(ImmediateContext* pParent)
      method ID3D12RootSignature (line 226) | ID3D12RootSignature* GetRootSignature() { return GetForUse(COMMAND_L...
    class RootSignature (line 229) | class RootSignature : public RootSignatureBase
      method RootSignature (line 232) | RootSignature(ImmediateContext* pParent, RootSignatureDesc const& desc)
  class std::hash<D3D12TranslationLayer::RootSignatureDesc> (line 246) | class std::hash<D3D12TranslationLayer::RootSignatureDesc>

FILE: include/Sampler.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class Sampler (line 11) | class Sampler : public DeviceChild

FILE: include/Shader.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type RESOURCE_DIMENSION (line 7) | enum class RESOURCE_DIMENSION
    type SShaderDecls (line 26) | struct SShaderDecls
    class Shader (line 39) | class Shader : public DeviceChild, public SShaderDecls
      method UINT (line 53) | UINT OutputStreamMask() { return m_OutputStreamMask; }
      method D3D12_SHADER_BYTECODE (line 54) | const D3D12_SHADER_BYTECODE& GetByteCode() const{ return m_Desc; }

FILE: include/ShaderBinary.h
  type UINT (line 9) | typedef UINT CShaderToken;
  function namespace (line 21) | namespace D3D10ShaderBinary
  function class (line 82) | class COperandIndex
  type MinPrecQuantizeFunctionIndex (line 119) | enum MinPrecQuantizeFunctionIndex // Used by reference rasterizer (IHVs ...
  function class (line 136) | class COperandBase
  function UINT (line 165) | UINT SwizzleComponent(UINT index) const {return m_Swizzle[index];}
  function SetModifier (line 168) | void SetModifier(D3D10_SB_OPERAND_MODIFIER Modifier)
  function SetMinPrecision (line 177) | void SetMinPrecision(D3D11_SB_OPERAND_MIN_PRECISION MinPrec)
  function class (line 236) | class COperand: public COperandBase
  function class (line 524) | class COperand4: public COperandBase
  function class (line 798) | class COperandDst: public COperandBase
  function class (line 1025) | class COperand2D: public COperandBase
  type CGlobalFlagsDecl (line 1424) | struct CGlobalFlagsDecl
  type CInputSystemInterpretedValueDecl (line 1429) | struct CInputSystemInterpretedValueDecl
  type CInputSystemGeneratedValueDecl (line 1434) | struct CInputSystemGeneratedValueDecl
  type CInputPSDecl (line 1439) | struct CInputPSDecl
  type CInputPSSystemInterpretedValueDecl (line 1444) | struct CInputPSSystemInterpretedValueDecl
  type CInputPSSystemGeneratedValueDecl (line 1450) | struct CInputPSSystemGeneratedValueDecl
  type COutputSystemInterpretedValueDecl (line 1456) | struct COutputSystemInterpretedValueDecl
  type COutputSystemGeneratedValueDecl (line 1461) | struct COutputSystemGeneratedValueDecl
  type CIndexRangeDecl (line 1466) | struct CIndexRangeDecl
  type CResourceDecl (line 1471) | struct CResourceDecl
  type CConstantBufferDecl (line 1478) | struct CConstantBufferDecl
  type COutputTopologyDecl (line 1483) | struct COutputTopologyDecl
  type CInputPrimitiveDecl (line 1488) | struct CInputPrimitiveDecl
  type CGSMaxOutputVertexCountDecl (line 1493) | struct CGSMaxOutputVertexCountDecl
  type CGSInstanceCountDecl (line 1498) | struct CGSInstanceCountDecl
  type CSamplerDecl (line 1503) | struct CSamplerDecl
  type CStreamDecl (line 1508) | struct CStreamDecl
  type CTempsDecl (line 1513) | struct CTempsDecl
  type CIndexableTempDecl (line 1518) | struct CIndexableTempDecl
  type CHSDSInputControlPointCountDecl (line 1525) | struct CHSDSInputControlPointCountDecl
  type CHSOutputControlPointCountDecl (line 1530) | struct CHSOutputControlPointCountDecl
  type CTessellatorDomainDecl (line 1535) | struct CTessellatorDomainDecl
  type CTessellatorPartitioningDecl (line 1540) | struct CTessellatorPartitioningDecl
  type CTessellatorOutputPrimitiveDecl (line 1545) | struct CTessellatorOutputPrimitiveDecl
  type CHSMaxTessFactorDecl (line 1550) | struct CHSMaxTessFactorDecl
  type CHSForkPhaseInstanceCountDecl (line 1555) | struct CHSForkPhaseInstanceCountDecl
  type CHSJoinPhaseInstanceCountDecl (line 1560) | struct CHSJoinPhaseInstanceCountDecl
  type CShaderMessage (line 1565) | struct CShaderMessage
  type CCustomData (line 1574) | struct CCustomData
  type CFunctionTableDecl (line 1586) | struct CFunctionTableDecl
  type CInterfaceDecl (line 1593) | struct CInterfaceDecl
  type CFunctionBodyDecl (line 1603) | struct CFunctionBodyDecl
  type CInterfaceCall (line 1608) | struct CInterfaceCall
  type CThreadGroupDeclaration (line 1614) | struct CThreadGroupDeclaration
  type CTypedUAVDeclaration (line 1621) | struct CTypedUAVDeclaration
  type CStructuredUAVDeclaration (line 1628) | struct CStructuredUAVDeclaration
  type CRawUAVDeclaration (line 1634) | struct CRawUAVDeclaration
  type CRawTGSMDeclaration (line 1639) | struct CRawTGSMDeclaration
  type CStructuredTGSMDeclaration (line 1644) | struct CStructuredTGSMDeclaration
  type CStructuredSRVDeclaration (line 1650) | struct CStructuredSRVDeclaration
  type CSyncFlags (line 1655) | struct CSyncFlags
  function class (line 1663) | class CInstruction
  function ClearAllocations (line 1719) | void ClearAllocations()
  function COperandBase (line 1750) | const COperandBase& Operand(UINT Index) const {return m_Operands[Index];}
  function SetNumOperands (line 1752) | void SetNumOperands(UINT NumOperands) {m_NumOperands = NumOperands;}
  function SetTest (line 1754) | void SetTest(D3D10_SB_INSTRUCTION_TEST_BOOLEAN Test) {m_Test = Test;}
  function SetPreciseMask (line 1755) | void SetPreciseMask(UINT PreciseMask) {m_PreciseMask = PreciseMask;}
  function SetTexelOffset (line 1757) | void SetTexelOffset( const INT8 texelOffset[3] )
  function SetTexelOffset (line 1762) | void SetTexelOffset( INT8 x, INT8 y, INT8 z)
  function SetResourceDim (line 1769) | void SetResourceDim(D3D10_SB_RESOURCE_DIMENSION Dim,
  function class (line 1873) | class CShaderAsm
  function EmitInterfaceCall (line 2372) | void EmitInterfaceCall(COperandBase &InterfaceOperand,
  function EmitInputControlPointCountDecl (line 2382) | void EmitInputControlPointCountDecl(UINT Count)
  function EmitOutputControlPointCountDecl (line 2390) | void EmitOutputControlPointCountDecl(UINT Count)
  function EmitTessellatorDomainDecl (line 2398) | void EmitTessellatorDomainDecl(D3D11_SB_TESSELLATOR_DOMAIN Domain)
  function EmitTessellatorPartitioningDecl (line 2406) | void EmitTessellatorPartitioningDecl(D3D11_SB_TESSELLATOR_PARTITIONING P...
  function EmitTessellatorOutputPrimitiveDecl (line 2414) | void EmitTessellatorOutputPrimitiveDecl(D3D11_SB_TESSELLATOR_OUTPUT_PRIM...
  function EmitHSMaxTessFactorDecl (line 2422) | void EmitHSMaxTessFactorDecl(float MaxTessFactor)
  function EmitHSForkPhaseInstanceCountDecl (line 2431) | void EmitHSForkPhaseInstanceCountDecl(UINT InstanceCount)
  function EmitHSJoinPhaseInstanceCountDecl (line 2439) | void EmitHSJoinPhaseInstanceCountDecl(UINT InstanceCount)
  function EmitHSBeginPhase (line 2447) | void EmitHSBeginPhase(D3D10_SB_OPCODE_TYPE Phase)
  function EmitInputOutputControlPointIDDecl (line 2454) | void EmitInputOutputControlPointIDDecl(D3D11_SB_OPERAND_MIN_PRECISION Mi...
  function EmitInputForkInstanceIDDecl (line 2462) | void EmitInputForkInstanceIDDecl(D3D11_SB_OPERAND_MIN_PRECISION MinPreci...
  function EmitInputJoinInstanceIDDecl (line 2470) | void EmitInputJoinInstanceIDDecl(D3D11_SB_OPERAND_MIN_PRECISION MinPreci...
  function EmitThreadGroupDecl (line 2478) | void EmitThreadGroupDecl(UINT x, UINT y, UINT z)
  function EmitInputThreadIDDecl (line 2488) | void EmitInputThreadIDDecl(UINT WriteMask,
  function EmitInputThreadGroupIDDecl (line 2497) | void EmitInputThreadGroupIDDecl(UINT WriteMask,
  function EmitInputThreadIDInGroupDecl (line 2506) | void EmitInputThreadIDInGroupDecl(UINT WriteMask,
  function EmitInputThreadIDInGroupFlattenedDecl (line 2515) | void EmitInputThreadIDInGroupFlattenedDecl(D3D11_SB_OPERAND_MIN_PRECISIO...
  function EmitTypedUnorderedAccessViewDecl (line 2523) | void EmitTypedUnorderedAccessViewDecl(D3D10_SB_RESOURCE_DIMENSION Dimens...
  function EmitRawUnorderedAccessViewDecl (line 2542) | void EmitRawUnorderedAccessViewDecl(UINT URegIndex, UINT Flags)
  function EmitStructuredUnorderedAccessViewDecl (line 2551) | void EmitStructuredUnorderedAccessViewDecl(UINT URegIndex, UINT ByteStri...
  function EmitRawThreadGroupSharedMemoryDecl (line 2562) | void EmitRawThreadGroupSharedMemoryDecl(UINT GRegIndex, UINT ByteCount )
  function EmitStructuredThreadGroupSharedMemoryDecl (line 2571) | void EmitStructuredThreadGroupSharedMemoryDecl(UINT GRegIndex, UINT Byte...
  function EmitRawShaderResourceViewDecl (line 2581) | void EmitRawShaderResourceViewDecl(UINT TRegIndex)
  function EmitStructuredShaderResourceViewDecl (line 2589) | void EmitStructuredShaderResourceViewDecl(UINT TRegIndex, UINT ByteStride)
  function Emit (line 2603) | void Emit(UINT OpCode)
  function StartComplexEmit (line 2608) | void StartComplexEmit(UINT OpCode,
  function AddComplexEmit (line 2614) | void AddComplexEmit(UINT Data)
  function UINT (line 2622) | UINT GetComplexEmitPosition()
  function UpdateComplexEmitPosition (line 2626) | void UpdateComplexEmitPosition(UINT Pos,
  function EmitCustomData (line 2634) | void EmitCustomData( D3D10_SB_CUSTOMDATA_CLASS CustomDataClass,
  function UINT (line 2661) | UINT GetNumExecutableInstructions() {return m_NumExecutableInstructions;}
  function ENDINSTRUCTION (line 2674) | void ENDINSTRUCTION()
  function FUNC (line 2707) | void FUNC(UINT x)
  function Reset (line 2715) | void Reset()
  function Reserve (line 2724) | void Reserve(UINT SizeInUINTs)
  function class (line 2766) | class CShaderCodeParser
  function BOOL (line 2789) | BOOL EndOfShader() {return m_pCurrentToken >= m_pShaderEndToken;}
  function UINT (line 2795) | UINT CurrentTokenOffsetInBytes() { return CurrentTokenOffset() * sizeof(...
  function CONST (line 2797) | CONST CShaderToken* ParseOperandAt(COperandBase* pOperand,

FILE: include/SharedResourceHelpers.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class SOpenResourcePrivateData (line 9) | class SOpenResourcePrivateData
      method SOpenResourcePrivateData (line 12) | SOpenResourcePrivateData(DeferredDestructionType deferredDestruction...
      method DeferredDestructionType (line 15) | DeferredDestructionType GetDeferredDestructionType() { return m_defe...
    class SharedResourceHelpers (line 20) | class SharedResourceHelpers
      type CreationFlags (line 23) | struct CreationFlags

FILE: include/SubresourceHelpers.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type CBufferView (line 7) | struct CBufferView {}
    class CSubresourceSubset (line 9) | class CSubresourceSubset
      method CSubresourceSubset (line 12) | CSubresourceSubset() noexcept {}
    function DecomposeSubresourceIdxNonExtended (line 45) | inline void DecomposeSubresourceIdxNonExtended(UINT Subresource, UINT ...
    function DecomposeSubresourceIdxNonExtended (line 51) | inline void DecomposeSubresourceIdxNonExtended(UINT Subresource, UINT8...
    function DecomposeSubresourceIdxExtended (line 58) | inline void DecomposeSubresourceIdxExtended(UINT Subresource, UINT Num...
    function UINT (line 63) | inline UINT DecomposeSubresourceIdxExtendedGetMip(UINT Subresource, UI...
    function UINT (line 68) | inline UINT ComposeSubresourceIdxNonExtended(UINT MipLevel, UINT Array...
    function UINT (line 73) | inline UINT ComposeSubresourceIdxExtended(UINT MipLevel, UINT ArraySli...
    function UINT (line 78) | inline UINT ComposeSubresourceIdxArrayThenPlane(UINT NumMips, UINT Pla...
    function UINT (line 83) | inline UINT ConvertSubresourceIndexAddPlane(UINT Subresource, UINT Num...
    function UINT (line 89) | inline UINT ConvertSubresourceIndexRemovePlane(UINT Subresource, UINT ...
    function UINT (line 94) | inline UINT GetPlaneIdxFromSubresourceIdx(UINT Subresource, UINT NumSu...
    class CViewSubresourceSubset (line 99) | class CViewSubresourceSubset : public CSubresourceSubset
      type DepthStencilMode (line 102) | enum DepthStencilMode { ReadOnly, WriteOnly, ReadOrWrite }
      method CViewSubresourceSubset (line 105) | CViewSubresourceSubset() {}
      class CViewSubresourceIterator (line 124) | class CViewSubresourceIterator
    class CViewSubresourceSubset::CViewSubresourceIterator (line 157) | class CViewSubresourceSubset::CViewSubresourceIterator
    class CTileSubresourceSubset (line 180) | class CTileSubresourceSubset
      class CIterator (line 186) | class CIterator
    class CTileSubresourceSubset::CIterator (line 200) | class CTileSubresourceSubset::CIterator
    type ConvertToDescV1Support (line 218) | struct ConvertToDescV1Support
    type DescToViewDimension (line 227) | struct DescToViewDimension : ConvertToDescV1NotSupported
    type DescToViewDimension< D3D11_SHADER_RESOURCE_VIEW_DESC1 > (line 234) | struct DescToViewDimension< D3D11_SHADER_RESOURCE_VIEW_DESC1 > : Conve...
    type DescToViewDimension< D3D11_RENDER_TARGET_VIEW_DESC1 > (line 241) | struct DescToViewDimension< D3D11_RENDER_TARGET_VIEW_DESC1 > : Convert...
    type DescToViewDimension< D3D11_UNORDERED_ACCESS_VIEW_DESC1 > (line 248) | struct DescToViewDimension< D3D11_UNORDERED_ACCESS_VIEW_DESC1 > : Conv...
    function IsPow2 (line 255) | inline bool IsPow2(

FILE: include/SwapChainHelper.hpp
  type D3D12TranslationLayer (line 4) | namespace D3D12TranslationLayer
    class SwapChainHelper (line 6) | class SwapChainHelper

FILE: include/SwapChainManager.hpp
  type D3D12TranslationLayer (line 3) | namespace D3D12TranslationLayer
    class SwapChainManager (line 5) | class SwapChainManager

FILE: include/ThreadPool.hpp
  class CThreadPoolWork (line 5) | class CThreadPoolWork
    method WorkCallback (line 13) | static void CALLBACK WorkCallback(PTP_CALLBACK_INSTANCE, PVOID Context...
    method CThreadPoolWork (line 20) | CThreadPoolWork() = default;
    method CThreadPoolWork (line 23) | CThreadPoolWork(CThreadPoolWork const&) = delete;
    method CThreadPoolWork (line 24) | CThreadPoolWork(CThreadPoolWork&&) = delete;
    method CThreadPoolWork (line 25) | CThreadPoolWork& operator=(CThreadPoolWork const&) = delete;
    method CThreadPoolWork (line 26) | CThreadPoolWork& operator=(CThreadPoolWork&&) = delete;
    method Wait (line 28) | void Wait(bool bCancel = true)
  class CThreadPool (line 45) | class CThreadPool
    method CThreadPool (line 54) | CThreadPool()
    method CThreadPool (line 84) | CThreadPool(CThreadPool const&) = delete;
    method CThreadPool (line 85) | CThreadPool(CThreadPool&&) = delete;
    method CThreadPool (line 86) | CThreadPool& operator=(CThreadPool const&) = delete;
    method CThreadPool (line 87) | CThreadPool& operator=(CThreadPool&&) = delete;
    method SetCancelPendingWorkOnCleanup (line 89) | void SetCancelPendingWorkOnCleanup(bool bCancel) { m_bCancelPendingWor...
    method QueueThreadpoolWork (line 91) | void QueueThreadpoolWork(CThreadPoolWork& Work, std::function<void()> ...

FILE: include/Util.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class ImmediateContext (line 9) | class ImmediateContext
    class Resource (line 10) | class Resource
    type COMMAND_LIST_TYPE (line 12) | enum class COMMAND_LIST_TYPE {
    type AllocatorHeapType (line 30) | enum class AllocatorHeapType
    function COMMAND_LIST_TYPE (line 38) | inline COMMAND_LIST_TYPE CommandListType(AllocatorHeapType HeapType)
    function D3D12_HEAP_TYPE (line 51) | inline D3D12_HEAP_TYPE GetD3D12HeapType(AllocatorHeapType HeapType)
    function ThrowFailure (line 71) | inline void ThrowFailure(HRESULT hr)
    function ThrowIfHandleNull (line 80) | inline void ThrowIfHandleNull(HANDLE h)
    class SafeHANDLE (line 88) | class SafeHANDLE
      method SafeHANDLE (line 91) | SafeHANDLE() : m_h(NULL)
      method HANDLE (line 101) | HANDLE release()
    class ThrowingSafeHandle (line 109) | class ThrowingSafeHandle : public SafeHANDLE
      method ThrowingSafeHandle (line 112) | ThrowingSafeHandle(HANDLE h) noexcept(false)
    function AlignedHeapFree16 (line 143) | inline void AlignedHeapFree16(void* p) noexcept
    function T (line 158) | inline T Align(T uValue, T uAlign)
    function T (line 178) | inline T AlignAtLeast(T uValue, T uAlign)
    function BOOLEAN (line 185) | inline BOOLEAN IsListEmpty(_In_ const LIST_ENTRY * ListHead)
    function InitializeListHead (line 190) | inline void InitializeListHead(_Out_ PLIST_ENTRY ListHead)
    function BOOLEAN (line 195) | inline BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
    function InsertHeadList (line 212) | inline void InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Out_ PLIST_E...
    function InsertTailList (line 229) | inline void InsertTailList(_Inout_ PLIST_ENTRY ListHead, _Out_ __drv_a...
    type EShaderStage (line 246) | enum EShaderStage : UINT8
    type unique_comptr_deleter (line 268) | struct unique_comptr_deleter
    type unique_comptr (line 278) | struct unique_comptr : protected std::unique_ptr<T, Deleter>
      method unique_comptr (line 284) | unique_comptr()
      method unique_comptr (line 289) | explicit unique_comptr(T *p)
      method unique_comptr (line 299) | unique_comptr(unique_comptr<T, Del2> && other)
      method unique_comptr (line 305) | unique_comptr& operator=(unique_comptr<T, Del2> && other)
      method unique_comptr (line 311) | unique_comptr& operator=(pointer p)
      method unique_comptr (line 317) | unique_comptr& operator=(std::nullptr_t p)
      method reset (line 323) | void reset(pointer p = pointer())
      method reset (line 332) | void reset(std::nullptr_t p)
      method T (line 337) | T** operator&()
      method T (line 343) | T*const* operator&() const
      method unique_comptr (line 355) | unique_comptr& operator=(unique_comptr const&) = delete;
      method unique_comptr (line 356) | unique_comptr(unique_comptr const&) = delete;
    type PreallocatedArray (line 360) | struct PreallocatedArray
      method PreallocatedArray (line 366) | PreallocatedArray(UINT ArraySize, void*& Address, TConstructionArgs&...
      method PreallocatedArray (line 384) | PreallocatedArray(PreallocatedArray const&) = delete;
      method PreallocatedArray (line 385) | PreallocatedArray& operator=(PreallocatedArray const&) = delete;
      method clear (line 387) | void clear()
      method size (line 399) | size_t size() const { return std::distance(m_pBegin, m_pEnd); }
      method empty (line 400) | bool empty() const { return m_pBegin == m_pEnd; }
      method T (line 402) | T* begin() { return m_pBegin; }
      method T (line 403) | T const* begin() const { return m_pBegin; }
      method T (line 405) | T* end() { return m_pEnd; }
      method T (line 406) | T const* end() const { return m_pEnd; }
      method T (line 408) | T& operator[](UINT i) { assert(m_pBegin + i < m_pEnd); return m_pBeg...
      method T (line 409) | T const& operator[](UINT i) const { assert(m_pBegin + i < m_pEnd); r...
    type PreallocatedInlineArray (line 413) | struct PreallocatedInlineArray
      method PreallocatedInlineArray (line 420) | PreallocatedInlineArray(UINT ArraySize, void*& Address, TConstructio...
      method PreallocatedInlineArray (line 437) | PreallocatedInlineArray(PreallocatedInlineArray const&) = delete;
      method PreallocatedInlineArray (line 438) | PreallocatedInlineArray& operator=(PreallocatedInlineArray const&) =...
      method clearInline (line 440) | void clearInline()
      method clear (line 450) | void clear()
      method size (line 457) | size_t size() const { return m_Size; }
      method empty (line 458) | bool empty() const { return m_Size == 0; }
      method T (line 460) | T &operator[](UINT i) { assert(i < m_Size); return i < InlineSize ? ...
      method T (line 461) | T const& operator[](UINT i) const { assert(i < m_Size); return i < I...
    type ED3D11On12DebugFlags (line 465) | enum ED3D11On12DebugFlags
    type ResourceAllocationContext (line 478) | enum class ResourceAllocationContext
    function D3D12_RESOURCE_STATES (line 487) | inline D3D12_RESOURCE_STATES GetDefaultPoolState(AllocatorHeapType hea...
    function D3D_FEATURE_LEVEL (line 501) | inline D3D_FEATURE_LEVEL GetHardwareFeatureLevel(ID3D12Device *pDevice)
    function SetFeatureDataNodeIndex (line 518) | inline void SetFeatureDataNodeIndex(void *pFeatureSupportData, UINT Fe...
    type ScopeExit (line 529) | struct ScopeExit {
      method ScopeExit (line 530) | ScopeExit(F &&f) : f(std::forward<F>(f)) {}
    function MakeScopeExit (line 536) | inline ScopeExit<F> MakeScopeExit(F &&f) {
    function hash_combine (line 541) | inline void hash_combine(size_t & seed, const T & v)
    class OptLock (line 548) | class OptLock
      method TakeLock (line 552) | std::unique_lock<mutex_t> TakeLock() const
      method OptLock (line 556) | OptLock(bool bHaveLock = false)
      method EnsureLock (line 563) | void EnsureLock()
      method HasLock (line 570) | bool HasLock() const { return m_Lock.has_value(); }
    type CircularArray (line 573) | struct CircularArray
      type iterator (line 576) | struct iterator
        method iterator (line 585) | iterator( T* Begin, T* Current ) : m_Begin( Begin ), m_Current( Cu...
        method iterator (line 586) | iterator increment( ptrdiff_t distance ) const
        method iterator (line 592) | iterator& operator++() { *this = increment( 1 ); return *this; }
        method iterator (line 593) | iterator operator++( int ) { iterator ret = *this; *this = increme...
        method iterator (line 594) | iterator& operator--() { *this = increment( -1 ); return *this; }
        method iterator (line 595) | iterator operator--( int ) { iterator ret = *this; *this = increme...
        method iterator (line 596) | iterator operator+( ptrdiff_t v ) { return increment( v ); }
        method iterator (line 597) | iterator& operator+=( ptrdiff_t v ) { *this = increment( v ); retu...
        method iterator (line 598) | iterator operator-( ptrdiff_t v ) { return increment( -v ); }
        method iterator (line 599) | iterator& operator-=( ptrdiff_t v ) { *this = increment( -v ); ret...
        method reference (line 602) | reference operator*() { return *m_Current; }
        method pointer (line 603) | pointer operator->() { return m_Current; }
      method iterator (line 612) | iterator begin() { return iterator( m_Array, m_Array ); }
        method iterator (line 585) | iterator( T* Begin, T* Current ) : m_Begin( Begin ), m_Current( Cu...
        method iterator (line 586) | iterator increment( ptrdiff_t distance ) const
        method iterator (line 592) | iterator& operator++() { *this = increment( 1 ); return *this; }
        method iterator (line 593) | iterator operator++( int ) { iterator ret = *this; *this = increme...
        method iterator (line 594) | iterator& operator--() { *this = increment( -1 ); return *this; }
        method iterator (line 595) | iterator operator--( int ) { iterator ret = *this; *this = increme...
        method iterator (line 596) | iterator operator+( ptrdiff_t v ) { return increment( v ); }
        method iterator (line 597) | iterator& operator+=( ptrdiff_t v ) { *this = increment( v ); retu...
        method iterator (line 598) | iterator operator-( ptrdiff_t v ) { return increment( -v ); }
        method iterator (line 599) | iterator& operator-=( ptrdiff_t v ) { *this = increment( -v ); ret...
        method reference (line 602) | reference operator*() { return *m_Current; }
        method pointer (line 603) | pointer operator->() { return m_Current; }
      method T (line 613) | T& operator[]( size_t index ) { return *(begin() + index); }

FILE: include/VideoDecode.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class Resource (line 7) | class Resource
    function VIDEO_DECODE_PROFILE_BIT_DEPTH_INDEX (line 37) | constexpr VIDEO_DECODE_PROFILE_BIT_DEPTH_INDEX GetIndex(VIDEO_DECODE_P...
    type VIDEO_DECODE_COMPRESSED_BITSTREAM (line 64) | struct VIDEO_DECODE_COMPRESSED_BITSTREAM
    type VIDEO_DECODE_OUTPUT_CONVERSION_ARGUMENTS (line 71) | struct VIDEO_DECODE_OUTPUT_CONVERSION_ARGUMENTS
    type VIDEO_DECODE_DECRYPTION_ARGUMENTS (line 79) | struct VIDEO_DECODE_DECRYPTION_ARGUMENTS
    type VIDEO_DECODE_INPUT_STREAM_ARGUMENTS (line 91) | struct VIDEO_DECODE_INPUT_STREAM_ARGUMENTS
    type VIDEO_DECODE_COMPONENT_HISTOGRAM (line 99) | struct VIDEO_DECODE_COMPONENT_HISTOGRAM
    type VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS (line 107) | struct VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS
    class VideoDecode (line 116) | class VideoDecode : public DeviceChild
      method IsArrayOfTexturesEnabled (line 131) | bool IsArrayOfTexturesEnabled() const { return (m_ConfigDecoderSpeci...
      method T (line 149) | T *GetPicParams() { return static_cast<T*>(GetPicParams());}
      method T (line 151) | T *GetPicParams() const { return static_cast<T*>(GetPicParams());}
    class BatchedVideoDecode (line 173) | class BatchedVideoDecode : public BatchedDeviceChildImpl<VideoDecode>
      method BatchedVideoDecode (line 176) | BatchedVideoDecode(BatchedContext& Context, VideoDecodeCreationArgs ...
      method DecodeFrame (line 181) | void DecodeFrame(_In_ const VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pIn...
      method HRESULT (line 186) | HRESULT GetDecodingStatus(_Out_writes_bytes_(dataSize) void* pData, ...

FILE: include/VideoDecodeStatistics.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type _DXVA_PicEntry (line 21) | struct _DXVA_PicEntry
    class VideoDecodeStatistics (line 34) | class VideoDecodeStatistics : public DeviceChild
      type _StatisticsInfo (line 45) | struct _StatisticsInfo

FILE: include/VideoDevice.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class VideoDevice (line 11) | class VideoDevice : public DeviceChild
      method VideoDevice (line 15) | VideoDevice(_In_ ImmediateContext *pDevice)
      method ID3D12VideoDevice (line 35) | ID3D12VideoDevice* GetUnderlyingVideoDevice() noexcept { return m_sp...
      type ProfileInfo (line 38) | struct ProfileInfo {

FILE: include/VideoProcess.hpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    type VideoProcessView (line 10) | struct VideoProcessView
    type VIDEO_PROCESS_ORIENTATION_INFO (line 16) | struct VIDEO_PROCESS_ORIENTATION_INFO {
    type VIDEO_PROCESS_STREAM_INFO (line 22) | struct VIDEO_PROCESS_STREAM_INFO {
    type VIDEO_PROCESS_INPUT_ARGUMENTS (line 43) | struct VIDEO_PROCESS_INPUT_ARGUMENTS
      method ResetStreams (line 45) | void ResetStreams(UINT NumStreams)
    type VIDEO_PROCESS_OUTPUT_ARGUMENTS (line 102) | struct VIDEO_PROCESS_OUTPUT_ARGUMENTS
      method VIDEO_PROCESS_OUTPUT_ARGUMENTS (line 104) | VIDEO_PROCESS_OUTPUT_ARGUMENTS()
    class DeinterlacePrepass (line 136) | class DeinterlacePrepass
      method DeinterlacePrepass (line 139) | DeinterlacePrepass(ImmediateContext* pDevice, class VideoProcess* pV...
    class VideoProcessor (line 161) | class VideoProcessor : public DeviceChildImpl<ID3D12VideoProcessor>
    class VideoProcess (line 167) | class VideoProcess : public DeviceChild
      method VideoProcess (line 170) | VideoProcess(_In_ ImmediateContext *pDevice, D3D12_VIDEO_PROCESS_DEI...
    class BatchedVideoProcess (line 199) | class BatchedVideoProcess
    class BatchedVideoProcessImpl (line 208) | class BatchedVideoProcessImpl : public BatchedDeviceChildImpl<VideoPro...
      method BatchedVideoProcessImpl (line 211) | BatchedVideoProcessImpl(BatchedContext& Context, D3D12_VIDEO_PROCESS...
      method ProcessFrames (line 216) | void ProcessFrames(_Inout_updates_(NumInputStreams) VIDEO_PROCESS_IN...

FILE: include/VideoProcessEnum.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type VIDEO_PROCESS_ENUM_ARGS (line 7) | struct  VIDEO_PROCESS_ENUM_ARGS
    function GetPow2ScaleExponentFromMax (line 40) | inline bool GetPow2ScaleExponentFromMax(UINT Size, UINT Max, UINT Min,...
    function IsScaleSupported (line 54) | inline bool IsScaleSupported(const D3D12_VIDEO_SCALE_SUPPORT& ScaleSup...
    type ReferenceInfo (line 82) | struct ReferenceInfo
    class VideoProcessEnum (line 89) | class VideoProcessEnum : public DeviceChild
      method VideoProcessEnum (line 92) | VideoProcessEnum(_In_ ImmediateContext *pDevice) noexcept
      method UINT (line 101) | UINT GetVPInputFormatCount() { return (UINT)m_vpInputFormats.size(); }
      method UINT (line 102) | UINT GetVPOutputFormatCount() { return (UINT)m_vpOutputFormats.size(...
      method D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS (line 105) | D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS GetDeinterlaceSupport() { retu...
      method IsAutoProcessingSupported (line 106) | bool IsAutoProcessingSupported() { return m_autoprocessingSupported; }

FILE: include/VideoReferenceDataManager.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class VideoDecoder (line 12) | class VideoDecoder : public DeviceChildImpl<ID3D12VideoDecoder>
      method D3D12_VIDEO_DECODER_DESC (line 17) | D3D12_VIDEO_DECODER_DESC GetDesc() { return GetForImmediateUse()->Ge...
    class VideoDecoderHeap (line 20) | class VideoDecoderHeap : public DeviceChildImpl<ID3D12VideoDecoderHeap>
      method D3D12_VIDEO_DECODER_HEAP_DESC (line 25) | D3D12_VIDEO_DECODER_HEAP_DESC GetDesc() { return GetForImmediateUse(...
    type ReferenceOnlyDesc (line 28) | struct ReferenceOnlyDesc
    type ReferenceDataManager (line 35) | struct ReferenceDataManager
      method UINT (line 40) | UINT Size() const { return (UINT)textures.size(); }
      method IsReferenceOnly (line 41) | bool IsReferenceOnly() { return m_fReferenceOnly; }
      type ReferenceData (line 73) | struct ReferenceData

FILE: include/VideoViewHelper.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type VIDEO_DECODER_OUTPUT_VIEW_DESC_INTERNAL (line 7) | struct VIDEO_DECODER_OUTPUT_VIEW_DESC_INTERNAL
    type VIDEO_PROCESSOR_INPUT_VIEW_DESC_INTERNAL (line 13) | struct VIDEO_PROCESSOR_INPUT_VIEW_DESC_INTERNAL
    type VIDEO_PROCESSOR_OUTPUT_VIEW_DESC_INTERNAL (line 20) | struct VIDEO_PROCESSOR_OUTPUT_VIEW_DESC_INTERNAL

FILE: include/View.hpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    class Resource (line 7) | class Resource
    class CViewBindingsImpl (line 14) | class CViewBindingsImpl
      method CViewBindingsImpl (line 17) | CViewBindingsImpl() { D3D12TranslationLayer::InitializeListHead(&m_V...
      method IsViewBound (line 20) | bool IsViewBound() { return !D3D12TranslationLayer::IsListEmpty(&m_V...
      method ViewBound (line 22) | void ViewBound(UINT stage, UINT slot) { m_BindPoints[stage].set(slot...
      method ViewUnbound (line 23) | void ViewUnbound(UINT stage, UINT slot) { assert(m_BindPoints[stage]...
    type ShaderResourceViewType (line 36) | enum class ShaderResourceViewType {}
    type RenderTargetViewType (line 37) | enum class RenderTargetViewType {}
    type DepthStencilViewType (line 38) | enum class DepthStencilViewType {}
    type UnorderedAccessViewType (line 39) | enum class UnorderedAccessViewType {}
    type VideoDecoderOutputViewType (line 40) | enum class VideoDecoderOutputViewType {}
    type VideoProcessorInputViewType (line 41) | enum class VideoProcessorInputViewType {}
    type VideoProcessorOutputViewType (line 42) | enum class VideoProcessorOutputViewType {}
    type CViewMapper (line 45) | struct CViewMapper
    type D3D12_UNORDERED_ACCESS_VIEW_DESC_WRAPPER (line 47) | struct D3D12_UNORDERED_ACCESS_VIEW_DESC_WRAPPER
    type CViewBindingsMapper (line 77) | struct CViewBindingsMapper { using Type = CViewBindingsImpl<1, 1>; }
    type CViewBindingsMapper<ShaderResourceViewType> (line 78) | struct CViewBindingsMapper<ShaderResourceViewType> { using Type = CVie...
    type CViewBindingsMapper<RenderTargetViewType> (line 79) | struct CViewBindingsMapper<RenderTargetViewType> { using Type = CViewB...
    type CViewBindingsMapper<UnorderedAccessViewType> (line 80) | struct CViewBindingsMapper<UnorderedAccessViewType> { using Type = CVi...
    class ViewBase (line 83) | class ViewBase : public DeviceChild
    class View (line 106) | class View : public ViewBase
      type TBinder (line 113) | struct TBinder
        method Bound (line 115) | static void Bound(View<TIface>* pView, UINT slot, EShaderStage sta...
        method Unbound (line 116) | static void Unbound(View<TIface>* pView, UINT slot, EShaderStage s...
      method View (line 120) | static View *CreateView(ImmediateContext* pDevice, const typename TD...
      method DestroyView (line 121) | static void DestroyView(View* pView) { delete pView; }
      method D3D12_CPU_DESCRIPTOR_HANDLE (line 130) | D3D12_CPU_DESCRIPTOR_HANDLE GetRefreshedDescriptorHandle()
      method UINT16 (line 144) | UINT16 GetBindRefs() { return m_BindRefs; }
      method IncrementBindRefs (line 145) | void IncrementBindRefs() { m_BindRefs++; }
      method DecrementBindRefs (line 146) | void DecrementBindRefs()
    class UAV (line 176) | class UAV : public TUAV
      method UsedInCommandList (line 183) | void UsedInCommandList(COMMAND_LIST_TYPE commandListType, UINT64 id)
      method UAV (line 189) | static UAV *CreateView(ImmediateContext* pDevice, const TTranslation...
    class CDescriptorHeapManager (line 202) | class CDescriptorHeapManager
    type DescriptorHeapEntry (line 203) | struct DescriptorHeapEntry
      method DescriptorHeapEntry (line 205) | DescriptorHeapEntry(CDescriptorHeapManager *pDescriptorHeapManager, ...

FILE: include/XPlatHelpers.h
  function namespace (line 5) | namespace XPlatHelpers

FILE: include/segmented_stack.h
  type noop_unary (line 5) | struct noop_unary
  type T (line 20) | typedef T* pointer;
  type T (line 21) | typedef const T* const_pointer;
  type T (line 22) | typedef T& reference;
  type T (line 23) | typedef const T& const_reference;
  type size_type (line 24) | typedef size_t size_type;
  type difference_type (line 25) | typedef ptrdiff_t difference_type;
  function explicit (line 50) | explicit segment_range(void* p) :
  type const_pointer (line 62) | typedef const_pointer const_iterator;
  function const_iterator (line 63) | const_iterator begin() const;

FILE: src/Allocator.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function ID3D12Resource (line 7) | ID3D12Resource* InternalHeapAllocator::Allocate(UINT64 size)

FILE: src/BatchedContext.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function TCmd (line 10) | TCmd const& GetCommandData(const void*& pPtrToCommandValue)
    function TCmd (line 22) | TCmd const& GetCommandDataVariableSize(const void*& pPtrToCommandValue...
    type CommandDispatcher (line 35) | struct CommandDispatcher
    type CommandDispatcher<BatchedContext::CmdSetPipelineState::CmdValue> (line 36) | struct CommandDispatcher<BatchedContext::CmdSetPipelineState::CmdValue>
      method Execute (line 38) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDrawInstanced::CmdValue> (line 44) | struct CommandDispatcher<BatchedContext::CmdDrawInstanced::CmdValue>
      method Execute (line 46) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDrawIndexedInstanced::CmdValue> (line 52) | struct CommandDispatcher<BatchedContext::CmdDrawIndexedInstanced::CmdV...
      method Execute (line 54) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDispatch::CmdValue> (line 60) | struct CommandDispatcher<BatchedContext::CmdDispatch::CmdValue>
      method Execute (line 62) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDrawAuto::CmdValue> (line 68) | struct CommandDispatcher<BatchedContext::CmdDrawAuto::CmdValue>
      method Execute (line 70) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDrawInstancedIndirect::CmdValue> (line 76) | struct CommandDispatcher<BatchedContext::CmdDrawInstancedIndirect::Cmd...
      method Execute (line 78) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDrawIndexedInstancedIndirect::CmdValue> (line 84) | struct CommandDispatcher<BatchedContext::CmdDrawIndexedInstancedIndire...
      method Execute (line 86) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDispatchIndirect::CmdValue> (line 92) | struct CommandDispatcher<BatchedContext::CmdDispatchIndirect::CmdValue>
      method Execute (line 94) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetTopology::CmdValue> (line 100) | struct CommandDispatcher<BatchedContext::CmdSetTopology::CmdValue>
      method Execute (line 102) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetVertexBuffers::CmdValue> (line 108) | struct CommandDispatcher<BatchedContext::CmdSetVertexBuffers::CmdValue>
      method Execute (line 110) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetIndexBuffer::CmdValue> (line 123) | struct CommandDispatcher<BatchedContext::CmdSetIndexBuffer::CmdValue>
      method Execute (line 125) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetShaderResources::CmdValue> (line 131) | struct CommandDispatcher<BatchedContext::CmdSetShaderResources::CmdValue>
      method Execute (line 133) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetSamplers::CmdValue> (line 148) | struct CommandDispatcher<BatchedContext::CmdSetSamplers::CmdValue>
      method Execute (line 150) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetConstantBuffers::CmdValue> (line 165) | struct CommandDispatcher<BatchedContext::CmdSetConstantBuffers::CmdValue>
      method Execute (line 167) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetConstantBuffersNullOffsetSize::CmdValue> (line 188) | struct CommandDispatcher<BatchedContext::CmdSetConstantBuffersNullOffs...
      method Execute (line 190) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetSOBuffers::CmdValue> (line 205) | struct CommandDispatcher<BatchedContext::CmdSetSOBuffers::CmdValue>
      method Execute (line 207) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetRenderTargets::CmdValue> (line 213) | struct CommandDispatcher<BatchedContext::CmdSetRenderTargets::CmdValue>
      method Execute (line 215) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetUAV::CmdValue> (line 221) | struct CommandDispatcher<BatchedContext::CmdSetUAV::CmdValue>
      method Execute (line 223) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetStencilRef::CmdValue> (line 236) | struct CommandDispatcher<BatchedContext::CmdSetStencilRef::CmdValue>
      method Execute (line 238) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetBlendFactor::CmdValue> (line 244) | struct CommandDispatcher<BatchedContext::CmdSetBlendFactor::CmdValue>
      method Execute (line 246) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetViewport::CmdValue> (line 252) | struct CommandDispatcher<BatchedContext::CmdSetViewport::CmdValue>
      method Execute (line 254) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetNumViewports::CmdValue> (line 260) | struct CommandDispatcher<BatchedContext::CmdSetNumViewports::CmdValue>
      method Execute (line 262) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetScissorRect::CmdValue> (line 268) | struct CommandDispatcher<BatchedContext::CmdSetScissorRect::CmdValue>
      method Execute (line 270) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetNumScissorRects::CmdValue> (line 276) | struct CommandDispatcher<BatchedContext::CmdSetNumScissorRects::CmdValue>
      method Execute (line 278) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetScissorEnable::CmdValue> (line 284) | struct CommandDispatcher<BatchedContext::CmdSetScissorEnable::CmdValue>
      method Execute (line 286) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearRenderTargetView::CmdValue> (line 292) | struct CommandDispatcher<BatchedContext::CmdClearRenderTargetView::Cmd...
      method Execute (line 294) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearDepthStencilView::CmdValue> (line 301) | struct CommandDispatcher<BatchedContext::CmdClearDepthStencilView::Cmd...
      method Execute (line 303) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearUnorderedAccessViewUint::CmdValue> (line 310) | struct CommandDispatcher<BatchedContext::CmdClearUnorderedAccessViewUi...
      method Execute (line 312) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearUnorderedAccessViewFloat::CmdValue> (line 319) | struct CommandDispatcher<BatchedContext::CmdClearUnorderedAccessViewFl...
      method Execute (line 321) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearVideoDecoderOutputView::CmdValue> (line 328) | struct CommandDispatcher<BatchedContext::CmdClearVideoDecoderOutputVie...
      method Execute (line 330) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearVideoProcessorInputView::CmdValue> (line 337) | struct CommandDispatcher<BatchedContext::CmdClearVideoProcessorInputVi...
      method Execute (line 339) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearVideoProcessorOutputView::CmdValue> (line 346) | struct CommandDispatcher<BatchedContext::CmdClearVideoProcessorOutputV...
      method Execute (line 348) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDiscardView::CmdValue> (line 355) | struct CommandDispatcher<BatchedContext::CmdDiscardView::CmdValue>
      method Execute (line 357) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdDiscardResource::CmdValue> (line 364) | struct CommandDispatcher<BatchedContext::CmdDiscardResource::CmdValue>
      method Execute (line 366) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdGenMips::CmdValue> (line 373) | struct CommandDispatcher<BatchedContext::CmdGenMips::CmdValue>
      method Execute (line 375) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdFinalizeUpdateSubresources::CmdValue> (line 381) | struct CommandDispatcher<BatchedContext::CmdFinalizeUpdateSubresources...
      method Execute (line 383) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdFinalizeUpdateSubresourcesWithLocalPlacement::CmdValue> (line 389) | struct CommandDispatcher<BatchedContext::CmdFinalizeUpdateSubresources...
      method Execute (line 391) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdRename::CmdValue> (line 397) | struct CommandDispatcher<BatchedContext::CmdRename::CmdValue>
      method Execute (line 399) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdRenameViaCopy::CmdValue> (line 405) | struct CommandDispatcher<BatchedContext::CmdRenameViaCopy::CmdValue>
      method Execute (line 407) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdQueryBegin::CmdValue> (line 413) | struct CommandDispatcher<BatchedContext::CmdQueryBegin::CmdValue>
      method Execute (line 415) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdQueryEnd::CmdValue> (line 421) | struct CommandDispatcher<BatchedContext::CmdQueryEnd::CmdValue>
      method Execute (line 423) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetPredication::CmdValue> (line 429) | struct CommandDispatcher<BatchedContext::CmdSetPredication::CmdValue>
      method Execute (line 431) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdResourceCopy::CmdValue> (line 437) | struct CommandDispatcher<BatchedContext::CmdResourceCopy::CmdValue>
      method Execute (line 439) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdResolveSubresource::CmdValue> (line 445) | struct CommandDispatcher<BatchedContext::CmdResolveSubresource::CmdValue>
      method Execute (line 447) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdResourceCopyRegion::CmdValue> (line 453) | struct CommandDispatcher<BatchedContext::CmdResourceCopyRegion::CmdValue>
      method Execute (line 455) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetResourceMinLOD::CmdValue> (line 461) | struct CommandDispatcher<BatchedContext::CmdSetResourceMinLOD::CmdValue>
      method Execute (line 463) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdCopyStructureCount::CmdValue> (line 469) | struct CommandDispatcher<BatchedContext::CmdCopyStructureCount::CmdValue>
      method Execute (line 471) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdRotateResourceIdentities::CmdValue> (line 477) | struct CommandDispatcher<BatchedContext::CmdRotateResourceIdentities::...
      method Execute (line 479) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdExtension::CmdValue> (line 486) | struct CommandDispatcher<BatchedContext::CmdExtension::CmdValue>
      method Execute (line 488) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetHardwareProtection::CmdValue> (line 496) | struct CommandDispatcher<BatchedContext::CmdSetHardwareProtection::Cmd...
      method Execute (line 498) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdSetHardwareProtectionState::CmdValue> (line 504) | struct CommandDispatcher<BatchedContext::CmdSetHardwareProtectionState...
      method Execute (line 506) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdClearState::CmdValue> (line 512) | struct CommandDispatcher<BatchedContext::CmdClearState::CmdValue>
      method Execute (line 514) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdUpdateTileMappings::CmdValue> (line 520) | struct CommandDispatcher<BatchedContext::CmdUpdateTileMappings::CmdValue>
      method Execute (line 522) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdCopyTileMappings::CmdValue> (line 549) | struct CommandDispatcher<BatchedContext::CmdCopyTileMappings::CmdValue>
      method Execute (line 551) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdCopyTiles::CmdValue> (line 557) | struct CommandDispatcher<BatchedContext::CmdCopyTiles::CmdValue>
      method Execute (line 559) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdTiledResourceBarrier::CmdValue> (line 565) | struct CommandDispatcher<BatchedContext::CmdTiledResourceBarrier::CmdV...
      method Execute (line 567) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdResizeTilePool::CmdValue> (line 573) | struct CommandDispatcher<BatchedContext::CmdResizeTilePool::CmdValue>
      method Execute (line 575) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdExecuteNestedBatch::CmdValue> (line 581) | struct CommandDispatcher<BatchedContext::CmdExecuteNestedBatch::CmdValue>
      method Execute (line 583) | static void Execute(ImmediateContext&, const void*& pCommandData)
    type CommandDispatcher<BatchedContext::CmdSetMarker::CmdValue> (line 590) | struct CommandDispatcher<BatchedContext::CmdSetMarker::CmdValue>
      method Execute (line 592) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdBeginEvent::CmdValue> (line 599) | struct CommandDispatcher<BatchedContext::CmdBeginEvent::CmdValue>
      method Execute (line 601) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type CommandDispatcher<BatchedContext::CmdEndEvent::CmdValue> (line 608) | struct CommandDispatcher<BatchedContext::CmdEndEvent::CmdValue>
      method Execute (line 610) | static void Execute(ImmediateContext& ImmCtx, const void*& pCommandD...
    type DispatchArrayImpl (line 621) | struct DispatchArrayImpl
    type Temp (line 700) | struct alignas(BatchPrimitive)Temp { UINT CommandValue; TCmd Command; }
    type Temp (line 719) | struct Temp { UINT CommandValue; TCmd Command; TEntry FirstEntry; }
  type DispatchArrayImpl<0, Rest...> (line 630) | struct DispatchArrayImpl<0, Rest...>
  type Temp (line 825) | struct Temp { BatchedContext::CmdSetVertexBuffers Cmd; Resource* pFirstV...
  type Temp (line 837) | struct Temp { BatchedContext::CmdSetVertexBuffers Cmd; Resource* pFirstV...
  function CONST (line 875) | CONST UINT* pNumConstants)
  type Temp (line 898) | struct Temp { BatchedContext::CmdSetConstantBuffers Cmd; Resource* pFirs...
  type Temp (line 910) | struct Temp { BatchedContext::CmdSetConstantBuffers Cmd; Resource* pFirs...
  function CONST (line 946) | CONST UINT* pInitialCounts)
  function _Use_decl_annotations_ (line 1098) | _Use_decl_annotations_
  type Temp (line 1577) | struct Temp { BatchedContext::CmdUpdateTileMappings Cmd; D3D12_TILED_RES...
  type Temp (line 1618) | struct Temp { BatchedContext::CmdUpdateTileMappings Cmd; D3D12_TILED_RES...

FILE: src/BlitHelper.cpp
  type D3D12TranslationLayer (line 9) | namespace D3D12TranslationLayer
    function UINT (line 11) | static UINT RectHeight(const RECT& r)
    function UINT (line 16) | static UINT RectWidth(const RECT& r)
    type ConvertPSOStreamDescriptor (line 59) | struct ConvertPSOStreamDescriptor

FILE: src/ColorConvertHelper.cpp
  type D3D12TranslationLayer (line 8) | namespace D3D12TranslationLayer
    function PrimaryType (line 89) | static PrimaryType GetPrimaryType(DXGI_COLOR_SPACE_TYPE colorSpace)
    function NominalRangeType (line 110) | static NominalRangeType GetNominalRangeType(DXGI_COLOR_SPACE_TYPE colo...
    function clip (line 122) | static float clip(float low, float high, float val)
    function mulmatrix (line 127) | static void mulmatrix(_In_ const CCMatrix& matrix, _In_reads_(4) const...
    function _Use_decl_annotations_ (line 137) | _Use_decl_annotations_

FILE: src/CommandListManager.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function HRESULT (line 202) | HRESULT CommandListManager::PreExecuteCommandQueueCommand()
    function HRESULT (line 209) | HRESULT CommandListManager::PostExecuteCommandQueueCommand()
    function UINT64 (line 409) | UINT64 CommandListManager::EnsureFlushedAndFenced()
    function HRESULT (line 432) | HRESULT CommandListManager::EnqueueSetEvent(HANDLE hEvent) noexcept
    function D3D12_COMMAND_LIST_TYPE (line 547) | D3D12_COMMAND_LIST_TYPE CommandListManager::GetD3D12CommandListType(CO...

FILE: src/DeviceChild.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function UINT64 (line 12) | UINT64 DeviceChild::GetCommandListID(COMMAND_LIST_TYPE CommandListType...

FILE: src/DxbcBuilder.cpp
  function HRESULT (line 51) | HRESULT CDXBCBuilder::AppendBlob(DXBCFourCC BlobFourCC, UINT BlobSize, c...
  function HRESULT (line 124) | HRESULT CDXBCBuilder::AppendBlob(CDXBCParser *pParser, DXBCFourCC BlobFo...
  function HRESULT (line 144) | HRESULT CDXBCBuilder::GetFinalDXBC(void *pCallerAllocatedMemory, UINT *p...

FILE: src/Fence.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function HRESULT (line 36) | HRESULT TRANSLATION_API Fence::CreateSharedHandle(

FILE: src/FormatDescImpl.cpp
  function UINT (line 641) | UINT CD3D11FormatHelper::GetDetailTableIndex(DXGI_FORMAT  Format )
  function UINT (line 664) | UINT CD3D11FormatHelper::GetByteAlignment(DXGI_FORMAT Format)
  function HRESULT (line 678) | inline HRESULT DivideAndRoundUp(UINT dividend, UINT divisor, _Out_ UINT&...
  function HRESULT (line 692) | HRESULT CD3D11FormatHelper::CalculateExtraPlanarRows(
  function HRESULT (line 748) | HRESULT CD3D11FormatHelper::CalculateResourceSize(
  function IsPow2 (line 877) | inline bool IsPow2( UINT Val )
  function HRESULT (line 887) | HRESULT CD3D11FormatHelper::CalculateMinimumRowMajorRowPitch(DXGI_FORMAT...
  function HRESULT (line 943) | HRESULT CD3D11FormatHelper::CalculateMinimumRowMajorSlicePitch(DXGI_FORM...
  function UINT (line 985) | UINT CD3D11FormatHelper::GetBitsPerUnit(DXGI_FORMAT Format)
  function UINT (line 992) | UINT CD3D11FormatHelper::GetBitsPerElement(DXGI_FORMAT Format)
  function UINT (line 1004) | UINT CD3D11FormatHelper::GetDetailTableIndexNoThrow(DXGI_FORMAT  Format)
  function UINT (line 1013) | UINT CD3D11FormatHelper::GetNumComponentsInFormat( DXGI_FORMAT  Format )
  function UINT (line 1036) | UINT CD3D11FormatHelper::GetWidthAlignment(DXGI_FORMAT Format)
  function UINT (line 1041) | UINT CD3D11FormatHelper::GetHeightAlignment(DXGI_FORMAT Format)
  function UINT (line 1046) | UINT CD3D11FormatHelper::GetDepthAlignment(DXGI_FORMAT Format)
  function DXGI_FORMAT (line 1076) | DXGI_FORMAT CD3D11FormatHelper::GetParentFormat(DXGI_FORMAT Format)
  function DXGI_FORMAT (line 1082) | const DXGI_FORMAT* CD3D11FormatHelper::GetFormatCastSet(DXGI_FORMAT Format)
  function D3D11_FORMAT_TYPE_LEVEL (line 1088) | D3D11_FORMAT_TYPE_LEVEL CD3D11FormatHelper::GetTypeLevel(DXGI_FORMAT For...
  function D3D11_FORMAT_COMPONENT_NAME (line 1094) | D3D11_FORMAT_COMPONENT_NAME CD3D11FormatHelper::GetComponentName(DXGI_FO...
  function UINT (line 1109) | UINT CD3D11FormatHelper::GetBitsPerComponent(DXGI_FORMAT Format, UINT Ab...
  function D3D11_FORMAT_COMPONENT_INTERPRETATION (line 1119) | D3D11_FORMAT_COMPONENT_INTERPRETATION CD3D11FormatHelper::GetFormatCompo...
  function BOOL (line 1136) | BOOL CD3D11FormatHelper::Planar(DXGI_FORMAT Format)
  function BOOL (line 1142) | BOOL CD3D11FormatHelper::NonOpaquePlanar(DXGI_FORMAT Format)
  function BOOL (line 1148) | BOOL CD3D11FormatHelper::YUV(DXGI_FORMAT Format)
  function UINT (line 1232) | UINT CD3D11FormatHelper::NonOpaquePlaneCount(DXGI_FORMAT Format)

FILE: src/ImmediateContext.cpp
  type D3D12TranslationLayer (line 7) | namespace D3D12TranslationLayer
    function UINT (line 592) | UINT ImmediateContext::ReserveSlots(OnlineDescriptorHeap& Heap, UINT N...
    function UINT (line 617) | UINT ImmediateContext::ReserveSlotsForBindings(OnlineDescriptorHeap& H...
    function RootSignature (line 645) | RootSignature* ImmediateContext::CreateOrRetrieveRootSignature(RootSig...
    function D3D12_BOX (line 854) | D3D12_BOX ImmediateContext::GetSubresourceBoxFromBox(Resource *pSrc, U...
    function D3D12_BOX (line 928) | D3D12_BOX ImmediateContext::GetBoxFromResource(Resource *pSrc, UINT Sr...
  function CONST (line 1285) | CONST UINT* pInitialCounts )
  function CONST (line 1308) | CONST UINT* pInitialCounts)
  function T (line 1481) | T FloatTo(float x, T max = std::numeric_limits<T>::max())
  function ID3D12PipelineState (line 2112) | ID3D12PipelineState* ImmediateContext::PrepareGenerateMipsObjects(DXGI_F...
  type CopyDesc (line 2432) | struct CopyDesc
  function DepthStencilDeInterleavingUpload (line 2796) | void DepthStencilDeInterleavingUpload(DXGI_FORMAT ParentFormat, UINT Pla...
  function DepthStencilInterleavingReadback (line 2820) | void DepthStencilInterleavingReadback(DXGI_FORMAT ParentFormat, UINT Pla...
  function UINT (line 2844) | inline UINT Swap10bitRBPixel(UINT pixel)
  function Swap10bitRBUpload (line 2856) | inline void Swap10bitRBUpload(const BYTE* pSrcData, UINT SrcRowPitch, UI...
  function _Use_decl_annotations_ (line 2877) | _Use_decl_annotations_
  function _Use_decl_annotations_ (line 3328) | _Use_decl_annotations_
  function CalcNewTileCoords (line 3353) | inline void CalcNewTileCoords(D3D12_TILED_RESOURCE_COORDINATE &Coord, UI...
  function COMMAND_LIST_TYPE (line 3360) | COMMAND_LIST_TYPE ImmediateContext::GetFallbackCommandListType(UINT comm...
  function D3D12ResourceSuballocation (line 4051) | D3D12ResourceSuballocation ImmediateContext::AcquireSuballocatedHeapForR...
  function D3D12ResourceSuballocation (line 4065) | D3D12ResourceSuballocation ImmediateContext::AcquireSuballocatedHeap(All...
  function IsSyncPointLessThanOrEqual (line 4088) | inline bool IsSyncPointLessThanOrEqual(UINT64(&lhs)[(UINT)COMMAND_LIST_T...
  function MemcpySubresourceWithCopySize (line 4202) | void MemcpySubresourceWithCopySize(
  function HRESULT (line 5147) | HRESULT TRANSLATION_API ImmediateContext::CheckFormatSupport(_Out_ D3D12...
  function HRESULT (line 5342) | HRESULT TRANSLATION_API ImmediateContext::ResolveSharedResource(Resource...
  function PipelineState (line 5459) | PipelineState* ImmediateContext::GetPipelineState()
  function DXGI_FORMAT (line 5522) | DXGI_FORMAT ImmediateContext::GetParentForFormat(DXGI_FORMAT format)
  function HRESULT (line 5528) | HRESULT TRANSLATION_API ImmediateContext::GetDeviceState()
  function TRANSLATION_API (line 5534) | TRANSLATION_API void ImmediateContext::Signal(
  function TRANSLATION_API (line 5564) | TRANSLATION_API void ImmediateContext::Wait(
  function HRESULT (line 5750) | HRESULT TRANSLATION_API ImmediateContext::CloseAndSubmitGraphicsCommandL...
  function Resource (line 5805) | Resource* ImmediateContext::BltResolveManager::GetBltResolveTempForWindo...

FILE: src/Main.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function SetTraceloggingProvider (line 9) | void SetTraceloggingProvider(TraceLoggingHProvider hTracelogging)

FILE: src/MaxFrameLatencyHelper.cpp
  type D3D12TranslationLayer (line 3) | namespace D3D12TranslationLayer
    function UINT (line 18) | UINT MaxFrameLatencyHelper::GetMaximumFrameLatency()

FILE: src/PipelineState.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    type PSOTraits (line 71) | struct PSOTraits
    type PSOTraits<e_Draw> (line 72) | struct PSOTraits<e_Draw>
      method GetCreate (line 74) | static decltype(&ID3D12Device::CreateGraphicsPipelineState) GetCreat...
      method D3D12_GRAPHICS_PIPELINE_STATE_DESC (line 75) | static const D3D12_GRAPHICS_PIPELINE_STATE_DESC &GetDesc(PipelineSta...
    type PSOTraits<e_Dispatch> (line 78) | struct PSOTraits<e_Dispatch>
      method GetCreate (line 80) | static decltype(&ID3D12Device::CreateComputePipelineState) GetCreate...
      method D3D12_COMPUTE_PIPELINE_STATE_DESC (line 81) | static const D3D12_COMPUTE_PIPELINE_STATE_DESC &GetDesc(PipelineStat...

FILE: src/Query.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function D3D12_QUERY_TYPE (line 163) | D3D12_QUERY_TYPE Query::GetType12() const
    function D3D12_QUERY_HEAP_TYPE (line 214) | D3D12_QUERY_HEAP_TYPE Query::GetHeapType12() const
    function UINT (line 264) | UINT Query::GetNumSubQueries() const
    function UINT (line 711) | UINT Query::GetDataSize12() const
    function UINT (line 816) | UINT Query::QueryIndex(UINT Instance, UINT SubQuery, UINT NumSubQueries)

FILE: src/Residency.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function HRESULT (line 180) | HRESULT ResidencyManager::Initialize(UINT DeviceNodeIndex, IDXCoreAdap...
    function HRESULT (line 216) | HRESULT ResidencyManager::ProcessPagingWork(UINT CommandListIndex, Res...
    function GetDXCoreBudget (line 395) | static void GetDXCoreBudget(IDXCoreAdapter *AdapterDXCore, UINT NodeIn...
    function GetDXGIBudget (line 404) | static void GetDXGIBudget(IDXGIAdapter3 *AdapterDXGI, UINT NodeIndex, ...

FILE: src/Resource.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function UINT8 (line 91) | inline UINT8 GetSubresourceMultiplier(ResourceCreationArgs const& crea...
    function UINT (line 97) | inline UINT GetTotalSubresources(ResourceCreationArgs const& createArg...
    function UINT (line 102) | inline UINT GetSubresourcesForTransitioning(ResourceCreationArgs const...
    function UINT (line 108) | inline UINT GetSubresourcesForFormatEmulationStagingAllocation(Resourc...
    function UINT (line 123) | inline UINT GetSubresourcesForFormatEmulationStagingData(ResourceCreat...
    function UINT (line 132) | inline UINT GetSubresourcesForTilingData(ResourceCreationArgs const& c...
    function UINT (line 139) | inline UINT GetSubresourcesForDynamicTexturePlaneData(ResourceCreation...
    function UINT (line 145) | inline UINT GetSubresourcesForCpuHeaps(ResourceCreationArgs const& cre...
    function IsSimultaneousAccess (line 151) | inline bool IsSimultaneousAccess(ResourceCreationArgs const& createArg...
    type VoidDeleter (line 214) | struct VoidDeleter { void operator()(void* p) { operator delete(p); } }
    class SwapChainAssistant (line 393) | class SwapChainAssistant : public ID3D12SwapChainAssistant
      method SwapChainAssistant (line 397) | SwapChainAssistant()
    function ManagedObject (line 594) | ManagedObject *Resource::GetResidencyHandle()
    function D3D12_PLACED_SUBRESOURCE_FOOTPRINT (line 678) | D3D12_PLACED_SUBRESOURCE_FOOTPRINT& Resource::GetSubresourcePlacement(...
    function UINT (line 804) | UINT Resource::DepthPitch(UINT Subresource) noexcept
    function D3D12_RANGE (line 822) | D3D12_RANGE Resource::GetSubresourceRange(UINT Subresource, _In_opt_ c...
    function UINT64 (line 860) | UINT64 Resource::GetResourceSize() noexcept
    function D3D12_HEAP_TYPE (line 869) | D3D12_HEAP_TYPE Resource::GetD3D12HeapType(RESOURCE_USAGE usage, UINT ...
    function Resource (line 1051) | Resource* Resource::GetCurrentCpuHeap(UINT Subresource)
    function HRESULT (line 1070) | HRESULT Resource::AddFenceForUnwrapResidency(ID3D12CommandQueue* pQueue)

FILE: src/ResourceBinding.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function D3D12_RESOURCE_STATES (line 134) | D3D12_RESOURCE_STATES CResourceBindings::GetD3D12ResourceUsageFromBind...
    function COMMAND_LIST_TYPE (line 165) | COMMAND_LIST_TYPE CResourceBindings::GetCommandListTypeFromBindings() ...

FILE: src/ResourceCache.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function ResourceCacheEntry (line 12) | ResourceCacheEntry const& ResourceCache::GetResource(DXGI_FORMAT forma...

FILE: src/ResourceState.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function UINT (line 155) | UINT CCurrentResourceState::GetCommandListTypeMask() const noexcept
    function UINT (line 171) | UINT CCurrentResourceState::GetCommandListTypeMask(CViewSubresourceSub...
    function UINT (line 189) | UINT CCurrentResourceState::GetCommandListTypeMask(UINT Subresource) c...
    function ShouldIgnoreTransitionRequest (line 238) | bool ShouldIgnoreTransitionRequest(CDesiredResourceState::SubresourceI...

FILE: src/RootSignature.cpp
  type D3D12TranslationLayer (line 7) | namespace D3D12TranslationLayer
    function D3D12_SHADER_VISIBILITY (line 24) | D3D12_SHADER_VISIBILITY GetShaderVisibility(EShaderStage stage)

FILE: src/Shader.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer

FILE: src/ShaderBinary.cpp
  type D3D10ShaderBinary (line 13) | namespace D3D10ShaderBinary
    function BOOL (line 16) | BOOL IsOpCodeValid(D3D10_SB_OPCODE_TYPE OpCode)
    function UINT (line 21) | UINT GetNumInstructionOperands(D3D10_SB_OPCODE_TYPE OpCode)
    function InitInstructionInfo (line 32) | void InitInstructionInfo()
    function D3D10_SB_TOKENIZED_PROGRAM_TYPE (line 303) | D3D10_SB_TOKENIZED_PROGRAM_TYPE CShaderCodeParser::ShaderType()
    function UINT (line 308) | UINT    CShaderCodeParser::CurrentTokenOffset()
    function UINT (line 313) | UINT    CShaderCodeParser::ShaderLengthInTokens()
    function UINT (line 318) | UINT CShaderCodeParser::ShaderMinorVersion()
    function UINT (line 323) | UINT CShaderCodeParser::ShaderMajorVersion()
    function BOOL (line 1172) | BOOL CInstruction::Disassemble( __out_ecount(StringSize) LPSTR pString...

FILE: src/ShaderParser.cpp
  type D3D12TranslationLayer (line 9) | namespace D3D12TranslationLayer

FILE: src/SharedResourceHelpers.cpp
  type D3D12TranslationLayer (line 11) | namespace D3D12TranslationLayer
    function SharedResourceLocalHandle (line 13) | SharedResourceLocalHandle TRANSLATION_API SharedResourceHelpers::Creat...
    function SharedResourceLocalHandle (line 24) | SharedResourceLocalHandle TRANSLATION_API SharedResourceHelpers::Creat...
    function SharedResourceLocalHandle (line 55) | SharedResourceLocalHandle SharedResourceHelpers::GetHandleForResource(...
    function UINT (line 106) | UINT ConvertPossibleBindFlags(D3D12_RESOURCE_DESC& Desc, D3D12_HEAP_FL...
    function UINT (line 141) | UINT ConvertHeapMiscFlags(D3D12_HEAP_FLAGS HeapFlags, bool bNtHandle, ...
    function UINT (line 150) | UINT ConvertPossibleCPUAccessFlags(D3D12_HEAP_PROPERTIES HeapProps, ID...

FILE: src/SubresourceHelpers.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function UINT (line 602) | UINT CSubresourceSubset::Mask() const noexcept
    function SIZE_T (line 623) | SIZE_T CSubresourceSubset::DoesNotOverlap( const CSubresourceSubset& o...
    function UINT (line 643) | UINT CSubresourceSubset::NumNonExtendedSubresources() const noexcept
    function UINT (line 649) | UINT CSubresourceSubset::NumExtendedSubresources() const noexcept
    function CViewSubresourceSubset (line 861) | CViewSubresourceSubset CViewSubresourceSubset::FromView( const T* pView )
    function UINT (line 909) | UINT CViewSubresourceSubset::MinSubresource() const
    function UINT (line 915) | UINT CViewSubresourceSubset::MaxSubresource() const
    function UINT (line 921) | UINT CViewSubresourceSubset::ArraySize() const
    function UINT (line 994) | UINT CViewSubresourceSubset::CViewSubresourceIterator::StartSubresourc...
    function UINT (line 1000) | UINT CViewSubresourceSubset::CViewSubresourceIterator::EndSubresource(...
    function CalcNewTileCoords (line 1013) | void CalcNewTileCoords(D3D11_TILED_RESOURCE_COORDINATE &Coord, UINT &N...
    function UINT (line 1109) | UINT CTileSubresourceSubset::CalcSubresource(UINT SubresourceIdx) const
    function UINT (line 1153) | UINT CTileSubresourceSubset::CIterator::operator*() const

FILE: src/SwapChainHelper.cpp
  type D3D12TranslationLayer (line 4) | namespace D3D12TranslationLayer
    function HRESULT (line 10) | HRESULT SwapChainHelper::StandardPresent( ImmediateContext& context, D...

FILE: src/SwapChainManager.cpp
  type D3D12TranslationLayer (line 4) | namespace D3D12TranslationLayer
    function IDXGISwapChain3 (line 13) | IDXGISwapChain3* SwapChainManager::GetSwapChainForWindow(HWND hwnd, Re...

FILE: src/Util.cpp
  type D3D12TranslationLayer (line 7) | namespace D3D12TranslationLayer
    function UINT (line 9) | UINT GetByteAlignment(DXGI_FORMAT format)
  function BOOL (line 19) | BOOL APIENTRY IntersectRect(
  function BOOL (line 52) | BOOL APIENTRY UnionRect(

FILE: src/VideoDecode.cpp
  type D3D12TranslationLayer (line 8) | namespace D3D12TranslationLayer
    type ProfileInfo (line 129) | struct ProfileInfo {
    type ETW_Pic_Entry (line 337) | struct ETW_Pic_Entry
    function ETW_Pic_Entry (line 346) | static ETW_Pic_Entry LogCopyPicEntry(const T& src)
    function LogCopyPicEntries (line 358) | static void LogCopyPicEntries(ETW_Pic_Entry (&dstPicEntries)[dstPicEnt...
    function _Use_decl_annotations_ (line 609) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 739) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 844) | _Use_decl_annotations_
    function LengthFromMinCb (line 882) | static inline int LengthFromMinCb(int length, int cbsize)
    function IsAdvancedProfile (line 888) | static inline bool IsAdvancedProfile(DXVA_PictureParameters *pPicParams)
    function _Use_decl_annotations_ (line 894) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 1045) | _Use_decl_annotations_
    function CopyNewStylePicParams (line 1129) | static void CopyNewStylePicParams(UINT& statusReportFeedbackNumber, DX...
    function _Use_decl_annotations_ (line 1139) | _Use_decl_annotations_
    function ProfileInfo (line 1205) | static ProfileInfo* GetProfileInfo(_In_ REFGUID DecodeProfile) noexcept
    function _Use_decl_annotations_ (line 1219) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 1227) | _Use_decl_annotations_
    function VIDEO_DECODE_PROFILE_BIT_DEPTH (line 1235) | VIDEO_DECODE_PROFILE_BIT_DEPTH VideoDecode::GetFormatBitDepth(DXGI_FOR...
    function GUID (line 1262) | GUID VideoDecode::GetDecodeProfile(VIDEO_DECODE_PROFILE_TYPE ProfileTy...
    function ProfileBufferInfo (line 1291) | static ProfileBufferInfo *GetProfileBufferInfo(_In_ REFGUID DecodeProf...
    function _Use_decl_annotations_ (line 1298) | _Use_decl_annotations_
    function IsXboxReuseDecoderProfileType (line 1317) | static bool IsXboxReuseDecoderProfileType(VIDEO_DECODE_PROFILE_TYPE Pr...
    function _Use_decl_annotations_ (line 1326) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 1437) | _Use_decl_annotations_
    function SupportsArrayOfTexture (line 1457) | static bool SupportsArrayOfTexture(const D3D12_FEATURE_DATA_VIDEO_DECO...
    function _Use_decl_annotations_ (line 1468) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 1482) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 1524) | _Use_decl_annotations_

FILE: src/VideoDecodeStatistics.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function SIZE_T (line 97) | SIZE_T VideoDecodeStatistics::GetStatStructSize(VIDEO_DECODE_PROFILE_T...
    function SIZE_T (line 287) | SIZE_T VideoDecodeStatistics::GetResultOffsetForIndex(UINT Index)

FILE: src/VideoDevice.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
    function _Use_decl_annotations_ (line 77) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 88) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 102) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 117) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 132) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 174) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 186) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 197) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 212) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 229) | _Use_decl_annotations_

FILE: src/VideoProcess.cpp
  type D3D12TranslationLayer (line 9) | namespace D3D12TranslationLayer
    function _Use_decl_annotations_ (line 57) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 85) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 98) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 116) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 143) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 199) | _Use_decl_annotations_
    function D3D12_VIDEO_PROCESS_ORIENTATION (line 332) | D3D12_VIDEO_PROCESS_ORIENTATION VIDEO_PROCESS_INPUT_ARGUMENTS::FinalOr...
    type VPPSOStream (line 603) | struct VPPSOStream

FILE: src/VideoProcessEnum.cpp
  type D3D12TranslationLayer (line 8) | namespace D3D12TranslationLayer
    function _Use_decl_annotations_ (line 21) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 68) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 85) | _Use_decl_annotations_
    function ReferenceInfo (line 100) | ReferenceInfo VideoProcessEnum::UpdateReferenceInfo(D3D12_VIDEO_PROCES...
    function _Use_decl_annotations_ (line 165) | _Use_decl_annotations_

FILE: src/VideoReferenceDataManager.cpp
  type D3D12TranslationLayer (line 5) | namespace D3D12TranslationLayer
    function UINT16 (line 8) | static UINT16 GetInvalidReferenceIndex(VIDEO_DECODE_PROFILE_TYPE Decod...
    function UINT16 (line 45) | UINT16 ReferenceDataManager::FindRemappedIndex(UINT16 originalIndex)
    function UINT16 (line 61) | UINT16 ReferenceDataManager::UpdateEntry(UINT16 index)
    function UINT16 (line 109) | UINT16 ReferenceDataManager::GetUpdatedEntry(UINT16 index)
    function _Use_decl_annotations_ (line 129) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 185) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 232) | _Use_decl_annotations_
    function _Use_decl_annotations_ (line 321) | _Use_decl_annotations_

FILE: src/View.cpp
  type D3D12TranslationLayer (line 6) | namespace D3D12TranslationLayer
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,248K chars).
[
  {
    "path": "CMakeLists.txt",
    "chars": 619,
    "preview": "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT License.\r\ncmake_minimum_required(VERSION 3.14)\r\nproject"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1359,
    "preview": "# Contributing\r\n\r\nThis project welcomes contributions and suggestions. Most contributions require you to\r\nagree to a Con"
  },
  {
    "path": "DxbcParser/CMakeLists.txt",
    "chars": 375,
    "preview": "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT License.\r\ncmake_minimum_required(VERSION 3.13)\r\nproject"
  },
  {
    "path": "DxbcParser/include/BlobContainer.h",
    "chars": 5534,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once \r\n#include <stddef.h>\r\n\r\n#defi"
  },
  {
    "path": "DxbcParser/include/DXBCUtils.h",
    "chars": 10400,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once \r\n#include \"BlobContainer.h\"\r\n"
  },
  {
    "path": "DxbcParser/include/pch.h",
    "chars": 134,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#include <d3d11_3.h>\r\n#incl"
  },
  {
    "path": "DxbcParser/src/BlobContainer.cpp",
    "chars": 7156,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n#include <dxbcutils.h>\r\n\r"
  },
  {
    "path": "DxbcParser/src/DXBCUtils.cpp",
    "chars": 52466,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n#include <dxbcutils.h>\r\n\r"
  },
  {
    "path": "LICENSE",
    "chars": 1093,
    "preview": "Copyright (c) Microsoft Corporation.\r\n\r\nMIT License\r\n\r\nPermission is hereby granted, free of charge, to any person obtai"
  },
  {
    "path": "README.md",
    "chars": 9751,
    "preview": "# D3D12 Translation Layer\r\n\r\nThe D3D12 Translation Layer is a helper library for translating graphics concepts and comma"
  },
  {
    "path": "SECURITY.md",
    "chars": 2757,
    "preview": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->\n\n## Security\n\nMicrosoft takes the security of our software products an"
  },
  {
    "path": "external/MicrosoftTelemetry.h",
    "chars": 3894,
    "preview": "/* ++\r\n\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the MIT License. See LICENSE in the p"
  },
  {
    "path": "external/d3d12compatibility.h",
    "chars": 11611,
    "preview": "/*-------------------------------------------------------------------------------------\n *\n * Copyright (c) Microsoft Co"
  },
  {
    "path": "external/d3dx12.h",
    "chars": 155356,
    "preview": "//*********************************************************\n//\n// Copyright (c) Microsoft. All rights reserved.\n// This "
  },
  {
    "path": "include/Allocator.h",
    "chars": 7518,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/BatchedContext.hpp",
    "chars": 32238,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/BatchedQuery.hpp",
    "chars": 851,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/BatchedResource.hpp",
    "chars": 1501,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/BlitHelper.hpp",
    "chars": 1935,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/BlitHelperShaders.h",
    "chars": 89609,
    "preview": "#if 0\r\n//\r\n// Generated by Microsoft (R) HLSL Shader Compiler 10.1\r\n//\r\n//\r\n// Buffer Definitions: \r\n//\r\n// cbuffer srcI"
  },
  {
    "path": "include/BlockAllocators.h",
    "chars": 16558,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#include <memory>\r\n\r\n//===="
  },
  {
    "path": "include/BlockAllocators.inl",
    "chars": 13843,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace BlockAllocators\r\n"
  },
  {
    "path": "include/CommandListManager.hpp",
    "chars": 7276,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/D3D12TranslationLayerDependencyIncludes.h",
    "chars": 1504,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n// The Windows build uses D"
  },
  {
    "path": "include/D3D12TranslationLayerIncludes.h",
    "chars": 1757,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#ifdef _WIN64\r\n#define USE_"
  },
  {
    "path": "include/DXGIColorSpaceHelper.h",
    "chars": 7070,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n// ------------------------"
  },
  {
    "path": "include/DeviceChild.hpp",
    "chars": 4214,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/DxbcBuilder.hpp",
    "chars": 4503,
    "preview": "#pragma once\r\n#include <BlobContainer.h>\r\n\r\n//=========================================================================="
  },
  {
    "path": "include/Fence.hpp",
    "chars": 1719,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/FormatDesc.hpp",
    "chars": 8319,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#define D3DFORMATDESC 1\r\n\r\n"
  },
  {
    "path": "include/ImmediateContext.hpp",
    "chars": 78127,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/ImmediateContext.inl",
    "chars": 70039,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\nnamespace D3D12TranslationLay"
  },
  {
    "path": "include/MaxFrameLatencyHelper.hpp",
    "chars": 1228,
    "preview": "#pragma once\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n\tclass MaxFrameLatencyHelper\r\n\t{\r\n    public:\r\n        void Init(Imm"
  },
  {
    "path": "include/PipelineState.hpp",
    "chars": 5434,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/PrecompiledShaders.h",
    "chars": 59936,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#if 0\r\n//\r\n// Generated by Microsoft (R) HL"
  },
  {
    "path": "include/Query.hpp",
    "chars": 7480,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/Residency.h",
    "chars": 17435,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/Resource.hpp",
    "chars": 37687,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/ResourceBinding.hpp",
    "chars": 15130,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/ResourceCache.hpp",
    "chars": 777,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/ResourceState.hpp",
    "chars": 27311,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/RootSignature.hpp",
    "chars": 10872,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#include <array>\r\n\r\nnamespa"
  },
  {
    "path": "include/Sampler.hpp",
    "chars": 807,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/Sampler.inl",
    "chars": 1022,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\nnamespace D3D12TranslationLay"
  },
  {
    "path": "include/Shader.hpp",
    "chars": 2159,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/Shader.inl",
    "chars": 4239,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\nnamespace D3D12TranslationLay"
  },
  {
    "path": "include/ShaderBinary.h",
    "chars": 113952,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#ifndef _SHADERBINARY_H\r\n#define _SHADERB"
  },
  {
    "path": "include/SharedResourceHelpers.hpp",
    "chars": 2479,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/SubresourceHelpers.hpp",
    "chars": 11619,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/SwapChainHelper.hpp",
    "chars": 379,
    "preview": "#pragma once\r\n#include \"d3dkmthk.h\"\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n    class SwapChainHelper\r\n    {\r\n    public:"
  },
  {
    "path": "include/SwapChainManager.hpp",
    "chars": 503,
    "preview": "#pragma once\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n    class SwapChainManager\r\n    {\r\n    public:\r\n        SwapChainMan"
  },
  {
    "path": "include/ThreadPool.hpp",
    "chars": 3209,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nclass CThreadPoolWork\r\n{\r\n "
  },
  {
    "path": "include/Util.hpp",
    "chars": 19084,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoDecode.hpp",
    "chars": 9976,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoDecodeStatistics.hpp",
    "chars": 2064,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoDevice.hpp",
    "chars": 2609,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoProcess.hpp",
    "chars": 11318,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n#include <array>\r\n\r\nnamespace"
  },
  {
    "path": "include/VideoProcessEnum.hpp",
    "chars": 5283,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoProcessShaders.h",
    "chars": 14345,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#if 0\r\n//\r\n// Generated by Microsoft (R) HL"
  },
  {
    "path": "include/VideoReferenceDataManager.hpp",
    "chars": 5319,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/VideoViewHelper.hpp",
    "chars": 635,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/View.hpp",
    "chars": 9379,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nnamespace D3D12TranslationL"
  },
  {
    "path": "include/View.inl",
    "chars": 11766,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\nnamespace D3D12TranslationLay"
  },
  {
    "path": "include/XPlatHelpers.h",
    "chars": 4644,
    "preview": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n#pragma once\n\nnamespace XPlatHelpers\n{\n#ifdef"
  },
  {
    "path": "include/commandlistmanager.inl",
    "chars": 454,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\nnamespace D3D12TranslationLay"
  },
  {
    "path": "include/pch.h",
    "chars": 191,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#include <D3D12TranslationL"
  },
  {
    "path": "include/segmented_stack.h",
    "chars": 16963,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\nstruct noop_unary\r\n{\r\n    v"
  },
  {
    "path": "packages.config",
    "chars": 152,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<packages>\r\n  <package id=\"WinPixEventRuntime\" version=\"1.0.190604001\" targetFr"
  },
  {
    "path": "scripts/BlitHelperShaders.hlsl",
    "chars": 5423,
    "preview": "#define RootSig \"RootFlags( DENY_GEOMETRY_SHADER_ROOT_ACCESS | \" \\\r\n                           \"DENY_DOMAIN_SHADER_ROOT_"
  },
  {
    "path": "scripts/CompileBlitHelperShaders.cmd",
    "chars": 979,
    "preview": "del tmp.txt\r\ndel BlitHelperShaders.h\r\n\r\nfxc /Tvs_5_1 /EVSMain /Vn g_VSMain BlitHelperShaders.hlsl /Fh tmp.txt\r\ntype tmp."
  },
  {
    "path": "scripts/CompileVideoProcessShaders.cmd",
    "chars": 291,
    "preview": "del tmp.txt\r\ndel VideoProcessShaders.h\r\n\r\nfxc /Tvs_5_1 /EVSMain /Vn g_DeinterlaceVS DeinterlaceShader.hlsl /Fh tmp.txt\r\n"
  },
  {
    "path": "scripts/DeinterlaceShader.hlsl",
    "chars": 1275,
    "preview": "#define RootSig \"RootFlags( DENY_VERTEX_SHADER_ROOT_ACCESS | \" \\\r\n                           \"DENY_GEOMETRY_SHADER_ROOT_"
  },
  {
    "path": "src/Allocator.cpp",
    "chars": 974,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/BatchedContext.cpp",
    "chars": 100362,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/BlitHelper.cpp",
    "chars": 20667,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include \"BlitHelperSha"
  },
  {
    "path": "src/CMakeLists.txt",
    "chars": 5581,
    "preview": "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT License.\r\ncmake_minimum_required(VERSION 3.13)\r\ninclude"
  },
  {
    "path": "src/ColorConvertHelper.cpp",
    "chars": 7802,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <dxva.h>\r\n#inc"
  },
  {
    "path": "src/CommandListManager.cpp",
    "chars": 21625,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/DeviceChild.cpp",
    "chars": 599,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/DxbcBuilder.cpp",
    "chars": 6680,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n#include \"BlobContainer.h"
  },
  {
    "path": "src/Fence.cpp",
    "chars": 1639,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/FormatDescImpl.cpp",
    "chars": 108012,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include <pch.h>\r\n#include <intsafe.h>\r\n\r\n#"
  },
  {
    "path": "src/ImmediateContext.cpp",
    "chars": 278043,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include \"PrecompiledSh"
  },
  {
    "path": "src/Main.cpp",
    "chars": 299,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/MaxFrameLatencyHelper.cpp",
    "chars": 1732,
    "preview": "#include \"pch.h\"\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n\tvoid MaxFrameLatencyHelper::Init(ImmediateContext* pImmCtx)\r\n\t{"
  },
  {
    "path": "src/PipelineState.cpp",
    "chars": 6172,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/Query.cpp",
    "chars": 46860,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/Residency.cpp",
    "chars": 18937,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/Resource.cpp",
    "chars": 53159,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/ResourceBinding.cpp",
    "chars": 8704,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/ResourceCache.cpp",
    "chars": 4570,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/ResourceState.cpp",
    "chars": 56083,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/RootSignature.cpp",
    "chars": 6485,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <numeric>\r\n\r\nn"
  },
  {
    "path": "src/Shader.cpp",
    "chars": 768,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/ShaderBinary.cpp",
    "chars": 66393,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <ShaderBinary."
  },
  {
    "path": "src/ShaderParser.cpp",
    "chars": 6833,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#pragma once\r\n\r\n#include \"pch.h\"\r\n#include "
  },
  {
    "path": "src/SharedResourceHelpers.cpp",
    "chars": 17937,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n#include \"SharedResourceH"
  },
  {
    "path": "src/SubresourceHelpers.cpp",
    "chars": 51990,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/SwapChainHelper.cpp",
    "chars": 2203,
    "preview": "#include \"pch.h\"\r\n#include \"SwapChainHelper.hpp\"\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n    SwapChainHelper::SwapChainHe"
  },
  {
    "path": "src/SwapChainManager.cpp",
    "chars": 2760,
    "preview": "#include \"pch.h\"\r\n#include \"SwapChainManager.hpp\"\r\n\r\nnamespace D3D12TranslationLayer\r\n{\r\n    SwapChainManager::SwapChain"
  },
  {
    "path": "src/Util.cpp",
    "chars": 2052,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\n\r\nnamespace D3D12Tran"
  },
  {
    "path": "src/VideoDecode.cpp",
    "chars": 79107,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <dxva.h>\r\n#inc"
  },
  {
    "path": "src/VideoDecodeStatistics.cpp",
    "chars": 14680,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <dxva.h>\r\nname"
  },
  {
    "path": "src/VideoDevice.cpp",
    "chars": 12039,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  },
  {
    "path": "src/VideoProcess.cpp",
    "chars": 40036,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <dxva.h>\r\n#inc"
  },
  {
    "path": "src/VideoProcessEnum.cpp",
    "chars": 18503,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n#include <dxva.h>\r\n#inc"
  },
  {
    "path": "src/VideoReferenceDataManager.cpp",
    "chars": 15378,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Translat"
  },
  {
    "path": "src/View.cpp",
    "chars": 5957,
    "preview": "// Copyright (c) Microsoft Corporation.\r\n// Licensed under the MIT License.\r\n\r\n#include \"pch.h\"\r\n\r\nnamespace D3D12Transl"
  }
]

About this extraction

This page contains the full source code of the microsoft/D3D12TranslationLayer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (2.0 MB), approximately 541.7k tokens, and a symbol index with 1569 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!