summaryrefslogtreecommitdiffstats
path: root/thirdparty/directx_headers
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/directx_headers')
-rw-r--r--thirdparty/directx_headers/d3dx12.h5459
-rw-r--r--thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp2627
-rw-r--r--thirdparty/directx_headers/include/directx/d3d12.h (renamed from thirdparty/directx_headers/d3d12.h)3284
-rw-r--r--thirdparty/directx_headers/include/directx/d3d12compatibility.h (renamed from thirdparty/directx_headers/d3d12compatibility.h)0
-rw-r--r--thirdparty/directx_headers/include/directx/d3d12sdklayers.h (renamed from thirdparty/directx_headers/d3d12sdklayers.h)149
-rw-r--r--thirdparty/directx_headers/include/directx/d3d12shader.h (renamed from thirdparty/directx_headers/d3d12shader.h)0
-rw-r--r--thirdparty/directx_headers/include/directx/d3d12video.h (renamed from thirdparty/directx_headers/d3d12video.h)673
-rw-r--r--thirdparty/directx_headers/include/directx/d3dcommon.h (renamed from thirdparty/directx_headers/d3dcommon.h)1
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12.h35
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_barriers.h192
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h1107
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_core.h1535
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_default.h12
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h1411
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_property_format_table.h124
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_render_pass.h102
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_resource_helpers.h602
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_root_signature.h1204
-rw-r--r--thirdparty/directx_headers/include/directx/d3dx12_state_object.h790
-rw-r--r--thirdparty/directx_headers/include/directx/dxcore.h (renamed from thirdparty/directx_headers/dxcore.h)0
-rw-r--r--thirdparty/directx_headers/include/directx/dxcore_interface.h (renamed from thirdparty/directx_headers/dxcore_interface.h)0
-rw-r--r--thirdparty/directx_headers/include/directx/dxgicommon.h (renamed from thirdparty/directx_headers/dxgicommon.h)0
-rw-r--r--thirdparty/directx_headers/include/directx/dxgiformat.h (renamed from thirdparty/directx_headers/dxgiformat.h)2
-rw-r--r--thirdparty/directx_headers/include/dxguids/dxguids.h195
24 files changed, 13958 insertions, 5546 deletions
diff --git a/thirdparty/directx_headers/d3dx12.h b/thirdparty/directx_headers/d3dx12.h
deleted file mode 100644
index bbe273d333..0000000000
--- a/thirdparty/directx_headers/d3dx12.h
+++ /dev/null
@@ -1,5459 +0,0 @@
-//*********************************************************
-//
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License (MIT).
-//
-//*********************************************************
-
-#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 ) noexcept
-{
- 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 ) noexcept
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RECT : public D3D12_RECT
-{
- CD3DX12_RECT() = default;
- explicit CD3DX12_RECT( const D3D12_RECT& o ) noexcept :
- D3D12_RECT( o )
- {}
- explicit CD3DX12_RECT(
- LONG Left,
- LONG Top,
- LONG Right,
- LONG Bottom ) noexcept
- {
- left = Left;
- top = Top;
- right = Right;
- bottom = Bottom;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT
-{
- CD3DX12_VIEWPORT() = default;
- explicit CD3DX12_VIEWPORT( const D3D12_VIEWPORT& o ) noexcept :
- D3D12_VIEWPORT( o )
- {}
- explicit CD3DX12_VIEWPORT(
- FLOAT topLeftX,
- FLOAT topLeftY,
- FLOAT width,
- FLOAT height,
- FLOAT minDepth = D3D12_MIN_DEPTH,
- FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept
- {
- 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 ) noexcept
- {
- const 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 = float(Desc.Width) - topLeftX;
- Height = 1.0f;
- break;
- case D3D12_RESOURCE_DIMENSION_TEXTURE1D:
- TopLeftX = topLeftX;
- TopLeftY = 0.0f;
- Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX;
- Height = 1.0f;
- break;
- case D3D12_RESOURCE_DIMENSION_TEXTURE2D:
- case D3D12_RESOURCE_DIMENSION_TEXTURE3D:
- TopLeftX = topLeftX;
- TopLeftY = topLeftY;
- Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX;
- Height = (SubresourceHeight ? float(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 ) noexcept :
- D3D12_BOX( o )
- {}
- explicit CD3DX12_BOX(
- LONG Left,
- LONG Right ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
-{
- 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 ) noexcept
-{ 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 ) noexcept :
- D3D12_DEPTH_STENCIL_DESC( o )
- {}
- explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept :
- D3D12_DEPTH_STENCIL_DESC1( o )
- {}
- explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 noexcept
- {
- 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_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2
-{
- CD3DX12_DEPTH_STENCIL_DESC2() = default;
- explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC2& o ) noexcept :
- D3D12_DEPTH_STENCIL_DESC2( o )
- {}
- explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept
- {
- DepthEnable = o.DepthEnable;
- DepthWriteMask = o.DepthWriteMask;
- DepthFunc = o.DepthFunc;
- StencilEnable = o.StencilEnable;
- FrontFace.StencilFailOp = o.FrontFace.StencilFailOp;
- FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp;
- FrontFace.StencilPassOp = o.FrontFace.StencilPassOp;
- FrontFace.StencilFunc = o.FrontFace.StencilFunc;
- FrontFace.StencilReadMask = o.StencilReadMask;
- FrontFace.StencilWriteMask = o.StencilWriteMask;
-
- BackFace.StencilFailOp = o.BackFace.StencilFailOp;
- BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp;
- BackFace.StencilPassOp = o.BackFace.StencilPassOp;
- BackFace.StencilFunc = o.BackFace.StencilFunc;
- BackFace.StencilReadMask = o.StencilReadMask;
- BackFace.StencilWriteMask = o.StencilWriteMask;
- DepthBoundsTestEnable = o.DepthBoundsTestEnable;
- }
- explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept
- {
- DepthEnable = o.DepthEnable;
- DepthWriteMask = o.DepthWriteMask;
- DepthFunc = o.DepthFunc;
- StencilEnable = o.StencilEnable;
-
- FrontFace.StencilFailOp = o.FrontFace.StencilFailOp;
- FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp;
- FrontFace.StencilPassOp = o.FrontFace.StencilPassOp;
- FrontFace.StencilFunc = o.FrontFace.StencilFunc;
- FrontFace.StencilReadMask = o.StencilReadMask;
- FrontFace.StencilWriteMask = o.StencilWriteMask;
-
- BackFace.StencilFailOp = o.BackFace.StencilFailOp;
- BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp;
- BackFace.StencilPassOp = o.BackFace.StencilPassOp;
- BackFace.StencilFunc = o.BackFace.StencilFunc;
- BackFace.StencilReadMask = o.StencilReadMask;
- BackFace.StencilWriteMask = o.StencilWriteMask;
-
- DepthBoundsTestEnable = FALSE;
- }
- explicit CD3DX12_DEPTH_STENCIL_DESC2( CD3DX12_DEFAULT ) noexcept
- {
- DepthEnable = TRUE;
- DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
- DepthFunc = D3D12_COMPARISON_FUNC_LESS;
- StencilEnable = FALSE;
- const D3D12_DEPTH_STENCILOP_DESC1 defaultStencilOp =
- { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS, D3D12_DEFAULT_STENCIL_READ_MASK, D3D12_DEFAULT_STENCIL_WRITE_MASK };
- FrontFace = defaultStencilOp;
- BackFace = defaultStencilOp;
- DepthBoundsTestEnable = FALSE;
- }
- explicit CD3DX12_DEPTH_STENCIL_DESC2(
- BOOL depthEnable,
- D3D12_DEPTH_WRITE_MASK depthWriteMask,
- D3D12_COMPARISON_FUNC depthFunc,
- BOOL stencilEnable,
- D3D12_STENCIL_OP frontStencilFailOp,
- D3D12_STENCIL_OP frontStencilDepthFailOp,
- D3D12_STENCIL_OP frontStencilPassOp,
- D3D12_COMPARISON_FUNC frontStencilFunc,
- UINT8 frontStencilReadMask,
- UINT8 frontStencilWriteMask,
- D3D12_STENCIL_OP backStencilFailOp,
- D3D12_STENCIL_OP backStencilDepthFailOp,
- D3D12_STENCIL_OP backStencilPassOp,
- D3D12_COMPARISON_FUNC backStencilFunc,
- UINT8 backStencilReadMask,
- UINT8 backStencilWriteMask,
- BOOL depthBoundsTestEnable ) noexcept
- {
- DepthEnable = depthEnable;
- DepthWriteMask = depthWriteMask;
- DepthFunc = depthFunc;
- StencilEnable = stencilEnable;
-
- FrontFace.StencilFailOp = frontStencilFailOp;
- FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
- FrontFace.StencilPassOp = frontStencilPassOp;
- FrontFace.StencilFunc = frontStencilFunc;
- FrontFace.StencilReadMask = frontStencilReadMask;
- FrontFace.StencilWriteMask = frontStencilWriteMask;
-
- BackFace.StencilFailOp = backStencilFailOp;
- BackFace.StencilDepthFailOp = backStencilDepthFailOp;
- BackFace.StencilPassOp = backStencilPassOp;
- BackFace.StencilFunc = backStencilFunc;
- BackFace.StencilReadMask = backStencilReadMask;
- BackFace.StencilWriteMask = backStencilWriteMask;
-
- DepthBoundsTestEnable = depthBoundsTestEnable;
- }
-
- operator D3D12_DEPTH_STENCIL_DESC() const noexcept
- {
- D3D12_DEPTH_STENCIL_DESC D;
- D.DepthEnable = DepthEnable;
- D.DepthWriteMask = DepthWriteMask;
- D.DepthFunc = DepthFunc;
- D.StencilEnable = StencilEnable;
- D.StencilReadMask = FrontFace.StencilReadMask;
- D.StencilWriteMask = FrontFace.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 ) noexcept :
- D3D12_BLEND_DESC( o )
- {}
- explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT ) noexcept
- {
- 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 ) noexcept :
- D3D12_RASTERIZER_DESC( o )
- {}
- explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT ) noexcept
- {
- 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) noexcept
- {
- 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 ) noexcept :
- D3D12_RESOURCE_ALLOCATION_INFO( o )
- {}
- CD3DX12_RESOURCE_ALLOCATION_INFO(
- UINT64 size,
- UINT64 alignment ) noexcept
- {
- 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) noexcept :
- D3D12_HEAP_PROPERTIES(o)
- {}
- CD3DX12_HEAP_PROPERTIES(
- D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
- D3D12_MEMORY_POOL memoryPoolPreference,
- UINT creationNodeMask = 1,
- UINT nodeMask = 1 ) noexcept
- {
- 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 ) noexcept
- {
- Type = type;
- CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
- MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
- CreationNodeMask = creationNodeMask;
- VisibleNodeMask = nodeMask;
- }
- bool IsCPUAccessible() const noexcept
- {
- 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 ) noexcept
-{
- 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 ) noexcept
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
-{
- CD3DX12_HEAP_DESC() = default;
- explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) noexcept :
- D3D12_HEAP_DESC(o)
- {}
- CD3DX12_HEAP_DESC(
- UINT64 size,
- D3D12_HEAP_PROPERTIES properties,
- UINT64 alignment = 0,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- SizeInBytes = resAllocInfo.SizeInBytes;
- Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
- Alignment = resAllocInfo.Alignment;
- Flags = flags;
- }
- bool IsCPUAccessible() const noexcept
- { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
-};
-inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept
-{
- 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 ) noexcept
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
-{
- CD3DX12_CLEAR_VALUE() = default;
- explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) noexcept :
- D3D12_CLEAR_VALUE(o)
- {}
- CD3DX12_CLEAR_VALUE(
- DXGI_FORMAT format,
- const FLOAT color[4] ) noexcept
- {
- Format = format;
- memcpy( Color, color, sizeof( Color ) );
- }
- CD3DX12_CLEAR_VALUE(
- DXGI_FORMAT format,
- FLOAT depth,
- UINT8 stencil ) noexcept
- {
- Format = format;
- memset( &Color, 0, sizeof( Color ) );
- /* 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) noexcept :
- D3D12_RANGE(o)
- {}
- CD3DX12_RANGE(
- SIZE_T begin,
- SIZE_T end ) noexcept
- {
- 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) noexcept :
- D3D12_RANGE_UINT64(o)
- {}
- CD3DX12_RANGE_UINT64(
- UINT64 begin,
- UINT64 end ) noexcept
- {
- 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) noexcept :
- D3D12_SUBRESOURCE_RANGE_UINT64(o)
- {}
- CD3DX12_SUBRESOURCE_RANGE_UINT64(
- UINT subresource,
- const D3D12_RANGE_UINT64& range ) noexcept
- {
- Subresource = subresource;
- Range = range;
- }
- CD3DX12_SUBRESOURCE_RANGE_UINT64(
- UINT subresource,
- UINT64 begin,
- UINT64 end ) noexcept
- {
- 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) noexcept :
- D3D12_SHADER_BYTECODE(o)
- {}
- CD3DX12_SHADER_BYTECODE(
- _In_ ID3DBlob* pShaderBlob ) noexcept
- {
- pShaderBytecode = pShaderBlob->GetBufferPointer();
- BytecodeLength = pShaderBlob->GetBufferSize();
- }
- CD3DX12_SHADER_BYTECODE(
- const void* _pShaderBytecode,
- SIZE_T bytecodeLength ) noexcept
- {
- 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) noexcept :
- D3D12_TILED_RESOURCE_COORDINATE(o)
- {}
- CD3DX12_TILED_RESOURCE_COORDINATE(
- UINT x,
- UINT y,
- UINT z,
- UINT subresource ) noexcept
- {
- 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) noexcept :
- D3D12_TILE_REGION_SIZE(o)
- {}
- CD3DX12_TILE_REGION_SIZE(
- UINT numTiles,
- BOOL useBox,
- UINT width,
- UINT16 height,
- UINT16 depth ) noexcept
- {
- 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) noexcept :
- D3D12_SUBRESOURCE_TILING(o)
- {}
- CD3DX12_SUBRESOURCE_TILING(
- UINT widthInTiles,
- UINT16 heightInTiles,
- UINT16 depthInTiles,
- UINT startTileIndexInOverallResource ) noexcept
- {
- 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) noexcept :
- D3D12_TILE_SHAPE(o)
- {}
- CD3DX12_TILE_SHAPE(
- UINT widthInTexels,
- UINT heightInTexels,
- UINT depthInTexels ) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_PACKED_MIP_INFO(o)
- {}
- CD3DX12_PACKED_MIP_INFO(
- UINT8 numStandardMips,
- UINT8 numPackedMips,
- UINT numTilesForPackedMips,
- UINT startTileIndexInOverallResource ) noexcept
- {
- 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) noexcept :
- D3D12_SUBRESOURCE_FOOTPRINT(o)
- {}
- CD3DX12_SUBRESOURCE_FOOTPRINT(
- DXGI_FORMAT format,
- UINT width,
- UINT height,
- UINT depth,
- UINT rowPitch ) noexcept
- {
- Format = format;
- Width = width;
- Height = height;
- Depth = depth;
- RowPitch = rowPitch;
- }
- explicit CD3DX12_SUBRESOURCE_FOOTPRINT(
- const D3D12_RESOURCE_DESC& resDesc,
- UINT rowPitch ) noexcept
- {
- Format = resDesc.Format;
- Width = UINT( resDesc.Width );
- Height = resDesc.Height;
- Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u);
- 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) noexcept :
- D3D12_TEXTURE_COPY_LOCATION(o)
- {}
- CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes) noexcept
- {
- pResource = pRes;
- Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
- PlacedFootprint = {};
- }
- CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint) noexcept
- {
- pResource = pRes;
- Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
- PlacedFootprint = Footprint;
- }
- CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub) noexcept
- {
- pResource = pRes;
- Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
- PlacedFootprint = {};
- SubresourceIndex = Sub;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
-{
- CD3DX12_DESCRIPTOR_RANGE() = default;
- explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_ROOT_DESCRIPTOR_TABLE(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR_TABLE(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept
- {
- Init(numDescriptorRanges, _pDescriptorRanges);
- }
-
- inline void Init(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_ROOT_CONSTANTS(o)
- {}
- CD3DX12_ROOT_CONSTANTS(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0) noexcept
- {
- Init(num32BitValues, shaderRegister, registerSpace);
- }
-
- inline void Init(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0) noexcept
- {
- Init(*this, num32BitValues, shaderRegister, registerSpace);
- }
-
- static inline void Init(
- _Out_ D3D12_ROOT_CONSTANTS &rootConstants,
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0) noexcept
- {
- 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) noexcept :
- D3D12_ROOT_DESCRIPTOR(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR(
- UINT shaderRegister,
- UINT registerSpace = 0) noexcept
- {
- Init(shaderRegister, registerSpace);
- }
-
- inline void Init(
- UINT shaderRegister,
- UINT registerSpace = 0) noexcept
- {
- Init(*this, shaderRegister, registerSpace);
- }
-
- static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
- }
-
- inline void InitAsConstants(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
- {
- InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsConstantBufferView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
- {
- InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsShaderResourceView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
- {
- InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsUnorderedAccessView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
- }
- CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_ROOT_DESCRIPTOR_TABLE1(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR_TABLE1(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept
- {
- Init(numDescriptorRanges, _pDescriptorRanges);
- }
-
- inline void Init(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_ROOT_DESCRIPTOR1(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR1(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept
- {
- Init(shaderRegister, registerSpace, flags);
- }
-
- inline void Init(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
- }
-
- inline void InitAsConstants(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_VERSIONED_ROOT_SIGNATURE_DESC(o)
- {}
- explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept
- {
- Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
- Desc_1_0 = o;
- }
- explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC1 &o) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- Init_1_1(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
- }
- CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_CPU_DESCRIPTOR_HANDLE(o)
- {}
- CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; }
- CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept
- {
- InitOffsetted(other, offsetScaledByIncrementSize);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- ptr = SIZE_T(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
- return *this;
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept
- {
- ptr = SIZE_T(INT64(ptr) + INT64(offsetScaledByIncrementSize));
- return *this;
- }
- bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept
- {
- return (ptr == other.ptr);
- }
- bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept
- {
- return (ptr != other.ptr);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other) noexcept
- {
- ptr = other.ptr;
- return *this;
- }
-
- inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
- {
- InitOffsetted(*this, base, offsetScaledByIncrementSize);
- }
-
- inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
- }
-
- static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
- {
- 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) noexcept
- {
- 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) noexcept :
- D3D12_GPU_DESCRIPTOR_HANDLE(o)
- {}
- CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; }
- CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept
- {
- InitOffsetted(other, offsetScaledByIncrementSize);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- ptr = UINT64(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
- return *this;
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept
- {
- ptr = UINT64(INT64(ptr) + INT64(offsetScaledByIncrementSize));
- return *this;
- }
- inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept
- {
- return (ptr == other.ptr);
- }
- inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept
- {
- return (ptr != other.ptr);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other) noexcept
- {
- ptr = other.ptr;
- return *this;
- }
-
- inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
- {
- InitOffsetted(*this, base, offsetScaledByIncrementSize);
- }
-
- inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
- {
- InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
- }
-
- static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
- {
- 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) noexcept
- {
- handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
- }
-};
-
-//------------------------------------------------------------------------------------------------
-constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept
-{
- 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 ) noexcept
-{
- 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
- ) noexcept
-{
- 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 ) noexcept :
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth,
- mipLevels, format, 1, 0, layout, flags );
- }
- inline UINT16 Depth() const noexcept
- { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
- inline UINT16 ArraySize() const noexcept
- { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
- inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept
- { return D3D12GetFormatPlaneCount(pDevice, Format); }
- inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept
- { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); }
- inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept
- { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
-};
-inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept
-{
- 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 ) noexcept
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
-{
- CD3DX12_RESOURCE_DESC1() = default;
- explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC1& o ) noexcept :
- D3D12_RESOURCE_DESC1( o )
- {}
- explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC& o ) noexcept
- {
- Dimension = o.Dimension;
- Alignment = o.Alignment;
- Width = o.Width;
- Height = o.Height;
- DepthOrArraySize = o.DepthOrArraySize;
- MipLevels = o.MipLevels;
- Format = o.Format;
- SampleDesc = o.SampleDesc;
- Layout = o.Layout;
- Flags = o.Flags;
- SamplerFeedbackMipRegion = {};
- }
- 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) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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 ) noexcept
- {
- 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) noexcept
- {
- 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 ) noexcept
- {
- 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 noexcept
- { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
- inline UINT16 ArraySize() const noexcept
- { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
- inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept
- { return D3D12GetFormatPlaneCount(pDevice, Format); }
- inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept
- { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); }
- inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept
- { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
-};
-inline bool operator==( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept
-{
- 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 ) noexcept
-{ 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 ) noexcept :
- D3D12_VIEW_INSTANCING_DESC( o )
- {}
- explicit CD3DX12_VIEW_INSTANCING_DESC( CD3DX12_DEFAULT ) noexcept
- {
- 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) noexcept
- {
- 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) noexcept
-{
- for (UINT z = 0; z < NumSlices; ++z)
- {
- auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
- auto pSrcSlice = static_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);
- }
- }
-}
-
-//------------------------------------------------------------------------------------------------
-// Row-by-row memcpy
-inline void MemcpySubresource(
- _In_ const D3D12_MEMCPY_DEST* pDest,
- _In_ const void* pResourceData,
- _In_ const D3D12_SUBRESOURCE_INFO* pSrc,
- SIZE_T RowSizeInBytes,
- UINT NumRows,
- UINT NumSlices) noexcept
-{
- for (UINT z = 0; z < NumSlices; ++z)
- {
- auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
- auto pSrcSlice = (static_cast<const BYTE*>(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * ULONG_PTR(z);
- for (UINT y = 0; y < NumRows; ++y)
- {
- memcpy(pDestSlice + pDest->RowPitch * y,
- pSrcSlice + pSrc->RowPitch * ULONG_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) noexcept
-{
- const 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) noexcept
-{
- // Minor validation
- const auto IntermediateDesc = pIntermediate->GetDesc();
- const 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)
- {
- const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
- const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]);
- pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr);
- }
- }
- 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_ const void* pResourceData,
- _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
-{
- // Minor validation
- const auto IntermediateDesc = pIntermediate->GetDesc();
- const 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, pResourceData, &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)
- {
- const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
- const 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) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
-{
- UINT64 RequiredSize = 0;
- const auto 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 = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
- auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
- auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
-
- const 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();
-
- const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
- HeapFree(GetProcessHeap(), 0, pMem);
- return Result;
-}
-
-//------------------------------------------------------------------------------------------------
-// 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_ const void* pResourceData,
- _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
-{
- UINT64 RequiredSize = 0;
- const auto 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 = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
- auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
- auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
-
- const 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();
-
- const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, 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) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
-{
- UINT64 RequiredSize = 0;
- D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
- UINT NumRows[MaxSubresources];
- UINT64 RowSizesInBytes[MaxSubresources];
-
- const 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);
-}
-
-//------------------------------------------------------------------------------------------------
-// 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_ const void* pResourceData,
- _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
-{
- UINT64 RequiredSize = 0;
- D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
- UINT NumRows[MaxSubresources];
- UINT64 RowSizesInBytes[MaxSubresources];
-
- const 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, pResourceData, pSrcData);
-}
-
-//------------------------------------------------------------------------------------------------
-constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept
-{ 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) noexcept
-{
- // 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) noexcept
-{
- 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 = static_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 = static_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))
- {
- const 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)
- {
- auto pDescriptorRanges_1_0 = pParameters_1_0[n].DescriptorTable.pDescriptorRanges;
- HeapFree(GetProcessHeap(), 0, reinterpret_cast<void*>(const_cast<D3D12_DESCRIPTOR_RANGE*>(pDescriptorRanges_1_0)));
- }
- }
- 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) noexcept
- : D3D12_RT_FORMAT_ARRAY(o)
- {}
- explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats) noexcept
- {
- NumRenderTargets = NumFormats;
- memcpy(RTFormats, pFormats, sizeof(RTFormats));
- // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats)
- }
-};
-
-//------------------------------------------------------------------------------------------------
-// Pipeline State Stream Helpers
-//------------------------------------------------------------------------------------------------
-
-//------------------------------------------------------------------------------------------------
-// Stream Subobjects, i.e. elements of a stream
-
-struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } };
-struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } };
-
-#pragma warning(push)
-#pragma warning(disable : 4324)
-template <typename InnerStructType, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type, typename DefaultArg = InnerStructType>
-class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT
-{
-private:
- D3D12_PIPELINE_STATE_SUBOBJECT_TYPE pssType;
- InnerStructType pssInner;
-public:
- CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT() noexcept : pssType(Type), pssInner(DefaultArg()) {}
- CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT(InnerStructType const& i) noexcept : pssType(Type), pssInner(i) {}
- CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT& operator=(InnerStructType const& i) noexcept { pssType = Type; pssInner = i; return *this; }
- operator InnerStructType const&() const noexcept { return pssInner; }
- operator InnerStructType&() noexcept { return pssInner; }
- InnerStructType* operator&() noexcept { return &pssInner; }
- InnerStructType const* operator&() const noexcept { return &pssInner; }
-};
-#pragma warning(pop)
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INPUT_LAYOUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT> CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INDEX_BUFFER_STRIP_CUT_VALUE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE> CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PRIMITIVE_TOPOLOGY_TYPE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY> CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS> CD3DX12_PIPELINE_STATE_STREAM_VS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS> CD3DX12_PIPELINE_STATE_STREAM_GS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_STREAM_OUTPUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT> CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS> CD3DX12_PIPELINE_STATE_STREAM_HS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS> CD3DX12_PIPELINE_STATE_STREAM_DS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS> CD3DX12_PIPELINE_STATE_STREAM_PS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS> CD3DX12_PIPELINE_STATE_STREAM_AS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS> CD3DX12_PIPELINE_STATE_STREAM_MS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS> CD3DX12_PIPELINE_STATE_STREAM_CS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_BLEND_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_FORMAT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_RT_FORMAT_ARRAY, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS> CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_SAMPLE_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, DefaultSampleDesc> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, DefaultSampleMask> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_CACHED_PIPELINE_STATE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO> CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO;
-typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_VIEW_INSTANCING_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING;
-
-//------------------------------------------------------------------------------------------------
-// Stream Parser Helpers
-
-struct ID3DX12PipelineParserCallbacks
-{
- // Subobject Callbacks
- virtual void FlagsCb(D3D12_PIPELINE_STATE_FLAGS) {}
- virtual void NodeMaskCb(UINT) {}
- virtual void RootSignatureCb(ID3D12RootSignature*) {}
- virtual void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC&) {}
- virtual void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE) {}
- virtual void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE) {}
- virtual void VSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void GSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC&) {}
- virtual void HSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void DSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void PSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void CSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void ASCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void MSCb(const D3D12_SHADER_BYTECODE&) {}
- virtual void BlendStateCb(const D3D12_BLEND_DESC&) {}
- virtual void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC&) {}
- virtual void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1&) {}
- virtual void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2&) {}
- virtual void DSVFormatCb(DXGI_FORMAT) {}
- virtual void RasterizerStateCb(const D3D12_RASTERIZER_DESC&) {}
- virtual void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY&) {}
- virtual void SampleDescCb(const DXGI_SAMPLE_DESC&) {}
- virtual void SampleMaskCb(UINT) {}
- virtual void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC&) {}
- virtual void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE&) {}
-
- // Error Callbacks
- virtual void ErrorBadInputParameter(UINT /*ParameterIndex*/) {}
- virtual void ErrorDuplicateSubobject(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE /*DuplicateType*/) {}
- virtual void ErrorUnknownSubobject(UINT /*UnknownTypeValue*/) {}
-
- virtual ~ID3DX12PipelineParserCallbacks() = default;
-};
-
-struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC
-{
- ID3D12RootSignature* pRootSignature;
- D3D12_SHADER_BYTECODE AS;
- D3D12_SHADER_BYTECODE MS;
- D3D12_SHADER_BYTECODE PS;
- D3D12_BLEND_DESC BlendState;
- UINT SampleMask;
- D3D12_RASTERIZER_DESC RasterizerState;
- D3D12_DEPTH_STENCIL_DESC DepthStencilState;
- D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
- UINT NumRenderTargets;
- DXGI_FORMAT RTVFormats[ D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ];
- DXGI_FORMAT DSVFormat;
- DXGI_SAMPLE_DESC SampleDesc;
- UINT NodeMask;
- D3D12_CACHED_PIPELINE_STATE CachedPSO;
- D3D12_PIPELINE_STATE_FLAGS Flags;
-};
-
-
-// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true
-// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline).
-// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
-// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
-struct CD3DX12_PIPELINE_STATE_STREAM3
-{
- CD3DX12_PIPELINE_STATE_STREAM3() = default;
- // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
- CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , InputLayout(Desc.InputLayout)
- , IBStripCutValue(Desc.IBStripCutValue)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , VS(Desc.VS)
- , GS(Desc.GS)
- , StreamOutput(Desc.StreamOutput)
- , HS(Desc.HS)
- , DS(Desc.DS)
- , PS(Desc.PS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM3(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , PS(Desc.PS)
- , AS(Desc.AS)
- , MS(Desc.MS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
- , CachedPSO(Desc.CachedPSO)
- {
- static_cast<D3D12_DEPTH_STENCIL_DESC2&>(DepthStencilState).DepthEnable = false;
- }
- CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
- CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
- CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
- CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
- CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
- CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
- CD3DX12_PIPELINE_STATE_STREAM_VS VS;
- CD3DX12_PIPELINE_STATE_STREAM_GS GS;
- CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
- CD3DX12_PIPELINE_STATE_STREAM_HS HS;
- CD3DX12_PIPELINE_STATE_STREAM_DS DS;
- CD3DX12_PIPELINE_STATE_STREAM_PS PS;
- CD3DX12_PIPELINE_STATE_STREAM_AS AS;
- CD3DX12_PIPELINE_STATE_STREAM_MS MS;
- CD3DX12_PIPELINE_STATE_STREAM_CS CS;
- CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
- CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
- CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
- CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
- CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
-
- D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
- {
- D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.InputLayout = this->InputLayout;
- D.IBStripCutValue = this->IBStripCutValue;
- D.PrimitiveTopologyType = this->PrimitiveTopologyType;
- D.VS = this->VS;
- D.GS = this->GS;
- D.StreamOutput = this->StreamOutput;
- D.HS = this->HS;
- D.DS = this->DS;
- D.PS = this->PS;
- D.BlendState = this->BlendState;
- D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState));
- D.DSVFormat = this->DSVFormat;
- D.RasterizerState = this->RasterizerState;
- D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
- memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
- D.SampleDesc = this->SampleDesc;
- D.SampleMask = this->SampleMask;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
- D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
- {
- D3D12_COMPUTE_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.CS = this->CS;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
-};
-
-
-// CD3DX12_PIPELINE_STATE_STREAM2 Works on OS Build 19041+ (where there is a new mesh shader pipeline).
-// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
-// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
-struct CD3DX12_PIPELINE_STATE_STREAM2
-{
- CD3DX12_PIPELINE_STATE_STREAM2() = default;
- // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
- CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , InputLayout(Desc.InputLayout)
- , IBStripCutValue(Desc.IBStripCutValue)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , VS(Desc.VS)
- , GS(Desc.GS)
- , StreamOutput(Desc.StreamOutput)
- , HS(Desc.HS)
- , DS(Desc.DS)
- , PS(Desc.PS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM2(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , PS(Desc.PS)
- , AS(Desc.AS)
- , MS(Desc.MS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
- , CachedPSO(Desc.CachedPSO)
- {
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false;
- }
- CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
- CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
- CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
- CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
- CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
- CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
- CD3DX12_PIPELINE_STATE_STREAM_VS VS;
- CD3DX12_PIPELINE_STATE_STREAM_GS GS;
- CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
- CD3DX12_PIPELINE_STATE_STREAM_HS HS;
- CD3DX12_PIPELINE_STATE_STREAM_DS DS;
- CD3DX12_PIPELINE_STATE_STREAM_PS PS;
- CD3DX12_PIPELINE_STATE_STREAM_AS AS;
- CD3DX12_PIPELINE_STATE_STREAM_MS MS;
- CD3DX12_PIPELINE_STATE_STREAM_CS CS;
- CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
- CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
- CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
- CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
- CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
- D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
- {
- D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.InputLayout = this->InputLayout;
- D.IBStripCutValue = this->IBStripCutValue;
- D.PrimitiveTopologyType = this->PrimitiveTopologyType;
- D.VS = this->VS;
- D.GS = this->GS;
- D.StreamOutput = this->StreamOutput;
- D.HS = this->HS;
- D.DS = this->DS;
- D.PS = this->PS;
- D.BlendState = this->BlendState;
- D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
- D.DSVFormat = this->DSVFormat;
- D.RasterizerState = this->RasterizerState;
- D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
- memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
- D.SampleDesc = this->SampleDesc;
- D.SampleMask = this->SampleMask;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
- D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
- {
- D3D12_COMPUTE_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.CS = this->CS;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
-};
-
-// CD3DX12_PIPELINE_STATE_STREAM1 Works on OS Build 16299+ (where there is a new view instancing subobject).
-// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
-struct CD3DX12_PIPELINE_STATE_STREAM1
-{
- CD3DX12_PIPELINE_STATE_STREAM1() = default;
- // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
- CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , InputLayout(Desc.InputLayout)
- , IBStripCutValue(Desc.IBStripCutValue)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , VS(Desc.VS)
- , GS(Desc.GS)
- , StreamOutput(Desc.StreamOutput)
- , HS(Desc.HS)
- , DS(Desc.DS)
- , PS(Desc.PS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM1(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , PS(Desc.PS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
- , CachedPSO(Desc.CachedPSO)
- {
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false;
- }
- CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
- CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
- CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
- CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
- CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
- CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
- CD3DX12_PIPELINE_STATE_STREAM_VS VS;
- CD3DX12_PIPELINE_STATE_STREAM_GS GS;
- CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
- CD3DX12_PIPELINE_STATE_STREAM_HS HS;
- CD3DX12_PIPELINE_STATE_STREAM_DS DS;
- CD3DX12_PIPELINE_STATE_STREAM_PS PS;
- CD3DX12_PIPELINE_STATE_STREAM_CS CS;
- CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
- CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
- CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
- CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
- CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
- D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
- {
- D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.InputLayout = this->InputLayout;
- D.IBStripCutValue = this->IBStripCutValue;
- D.PrimitiveTopologyType = this->PrimitiveTopologyType;
- D.VS = this->VS;
- D.GS = this->GS;
- D.StreamOutput = this->StreamOutput;
- D.HS = this->HS;
- D.DS = this->DS;
- D.PS = this->PS;
- D.BlendState = this->BlendState;
- D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
- D.DSVFormat = this->DSVFormat;
- D.RasterizerState = this->RasterizerState;
- D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
- memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
- D.SampleDesc = this->SampleDesc;
- D.SampleMask = this->SampleMask;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
- D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
- {
- D3D12_COMPUTE_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.CS = this->CS;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
-};
-
-
-struct CD3DX12_PIPELINE_MESH_STATE_STREAM
-{
- CD3DX12_PIPELINE_MESH_STATE_STREAM() = default;
- CD3DX12_PIPELINE_MESH_STATE_STREAM(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , PS(Desc.PS)
- , AS(Desc.AS)
- , MS(Desc.MS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
- {}
- CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
- CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
- CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
- CD3DX12_PIPELINE_STATE_STREAM_PS PS;
- CD3DX12_PIPELINE_STATE_STREAM_AS AS;
- CD3DX12_PIPELINE_STATE_STREAM_MS MS;
- CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
- CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
- CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
- CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
- CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
- D3DX12_MESH_SHADER_PIPELINE_STATE_DESC MeshShaderDescV0() const noexcept
- {
- D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.PS = this->PS;
- D.AS = this->AS;
- D.MS = this->MS;
- D.BlendState = this->BlendState;
- D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
- D.DSVFormat = this->DSVFormat;
- D.RasterizerState = this->RasterizerState;
- D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
- memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
- D.SampleDesc = this->SampleDesc;
- D.SampleMask = this->SampleMask;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
-};
-
-// CD3DX12_PIPELINE_STATE_STREAM works on OS Build 15063+ but does not support new subobject(s) added in OS Build 16299+.
-// See CD3DX12_PIPELINE_STATE_STREAM1 for instance.
-struct CD3DX12_PIPELINE_STATE_STREAM
-{
- CD3DX12_PIPELINE_STATE_STREAM() = default;
- CD3DX12_PIPELINE_STATE_STREAM(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , InputLayout(Desc.InputLayout)
- , IBStripCutValue(Desc.IBStripCutValue)
- , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
- , VS(Desc.VS)
- , GS(Desc.GS)
- , StreamOutput(Desc.StreamOutput)
- , HS(Desc.HS)
- , DS(Desc.DS)
- , PS(Desc.PS)
- , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
- , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
- , DSVFormat(Desc.DSVFormat)
- , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
- , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
- , SampleDesc(Desc.SampleDesc)
- , SampleMask(Desc.SampleMask)
- , CachedPSO(Desc.CachedPSO)
- {}
- CD3DX12_PIPELINE_STATE_STREAM(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
- : Flags(Desc.Flags)
- , NodeMask(Desc.NodeMask)
- , pRootSignature(Desc.pRootSignature)
- , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
- , CachedPSO(Desc.CachedPSO)
- {}
- CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
- CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
- CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
- CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
- CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
- CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
- CD3DX12_PIPELINE_STATE_STREAM_VS VS;
- CD3DX12_PIPELINE_STATE_STREAM_GS GS;
- CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
- CD3DX12_PIPELINE_STATE_STREAM_HS HS;
- CD3DX12_PIPELINE_STATE_STREAM_DS DS;
- CD3DX12_PIPELINE_STATE_STREAM_PS PS;
- CD3DX12_PIPELINE_STATE_STREAM_CS CS;
- CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
- CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
- CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
- CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
- CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
- CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
- D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
- {
- D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.InputLayout = this->InputLayout;
- D.IBStripCutValue = this->IBStripCutValue;
- D.PrimitiveTopologyType = this->PrimitiveTopologyType;
- D.VS = this->VS;
- D.GS = this->GS;
- D.StreamOutput = this->StreamOutput;
- D.HS = this->HS;
- D.DS = this->DS;
- D.PS = this->PS;
- D.BlendState = this->BlendState;
- D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
- D.DSVFormat = this->DSVFormat;
- D.RasterizerState = this->RasterizerState;
- D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
- memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
- D.SampleDesc = this->SampleDesc;
- D.SampleMask = this->SampleMask;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
- D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
- {
- D3D12_COMPUTE_PIPELINE_STATE_DESC D;
- D.Flags = this->Flags;
- D.NodeMask = this->NodeMask;
- D.pRootSignature = this->pRootSignature;
- D.CS = this->CS;
- D.CachedPSO = this->CachedPSO;
- return D;
- }
-};
-
-struct CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
-{
- CD3DX12_PIPELINE_STATE_STREAM2 PipelineStream;
- CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER() noexcept
- : SeenDSS(false)
- {
- // Adjust defaults to account for absent members.
- PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
-
- // Depth disabled if no DSV format specified.
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false;
- }
-
- // ID3DX12PipelineParserCallbacks
- void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;}
- void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;}
- void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;}
- void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;}
- void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;}
- void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;}
- void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;}
- void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;}
- void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;}
- void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;}
- void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;}
- void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;}
- void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;}
- void ASCb(const D3D12_SHADER_BYTECODE& AS) override {PipelineStream.AS = AS;}
- void MSCb(const D3D12_SHADER_BYTECODE& MS) override {PipelineStream.MS = MS;}
- void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);}
- void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
- SeenDSS = true;
- }
- void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
- SeenDSS = true;
- }
- void DSVFormatCb(DXGI_FORMAT DSVFormat) override
- {
- PipelineStream.DSVFormat = DSVFormat;
- if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
- {
- // Re-enable depth for the default state.
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true;
- }
- }
- void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);}
- void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;}
- void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;}
- void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;}
- void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);}
- void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;}
-
-private:
- bool SeenDSS;
-};
-
-
-struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
-{
- CD3DX12_PIPELINE_STATE_STREAM3 PipelineStream;
- CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER() noexcept
- : SeenDSS(false)
- {
- // Adjust defaults to account for absent members.
- PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
-
- // Depth disabled if no DSV format specified.
- static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = false;
- }
-
- // ID3DX12PipelineParserCallbacks
- void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; }
- void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; }
- void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; }
- void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; }
- void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; }
- void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; }
- void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; }
- void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; }
- void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; }
- void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; }
- void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; }
- void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; }
- void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; }
- void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; }
- void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; }
- void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); }
- void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
- SeenDSS = true;
- }
- void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
- SeenDSS = true;
- }
- void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
- SeenDSS = true;
- }
- void DSVFormatCb(DXGI_FORMAT DSVFormat) override
- {
- PipelineStream.DSVFormat = DSVFormat;
- if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
- {
- // Re-enable depth for the default state.
- static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = true;
- }
- }
- void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState); }
- void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; }
- void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; }
- void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; }
- void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); }
- void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; }
-
-private:
- bool SeenDSS;
-};
-
-struct CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
-{
- CD3DX12_PIPELINE_STATE_STREAM1 PipelineStream;
- CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER() noexcept
- : SeenDSS(false)
- {
- // Adjust defaults to account for absent members.
- PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
-
- // Depth disabled if no DSV format specified.
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false;
- }
-
- // ID3DX12PipelineParserCallbacks
- void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;}
- void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;}
- void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;}
- void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;}
- void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;}
- void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;}
- void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;}
- void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;}
- void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;}
- void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;}
- void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;}
- void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;}
- void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;}
- void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);}
- void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
- SeenDSS = true;
- }
- void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
- {
- PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
- SeenDSS = true;
- }
- void DSVFormatCb(DXGI_FORMAT DSVFormat) override
- {
- PipelineStream.DSVFormat = DSVFormat;
- if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
- {
- // Re-enable depth for the default state.
- static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true;
- }
- }
- void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);}
- void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;}
- void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;}
- void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;}
- void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);}
- void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;}
-
-private:
- bool SeenDSS;
-};
-
-inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE SubobjectType) noexcept
-{
- switch (SubobjectType)
- {
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1:
- return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2:
- return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL;
- default:
- return SubobjectType;
- }
-}
-
-inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& Desc, ID3DX12PipelineParserCallbacks* pCallbacks)
-{
- if (pCallbacks == nullptr)
- {
- return E_INVALIDARG;
- }
-
- if (Desc.SizeInBytes == 0 || Desc.pPipelineStateSubobjectStream == nullptr)
- {
- pCallbacks->ErrorBadInputParameter(1); // first parameter issue
- return E_INVALIDARG;
- }
-
- bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {};
- for (SIZE_T CurOffset = 0, SizeOfSubobject = 0; CurOffset < Desc.SizeInBytes; CurOffset += SizeOfSubobject)
- {
- BYTE* pStream = static_cast<BYTE*>(Desc.pPipelineStateSubobjectStream)+CurOffset;
- auto SubobjectType = *reinterpret_cast<D3D12_PIPELINE_STATE_SUBOBJECT_TYPE*>(pStream);
- if (SubobjectType < 0 || SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID)
- {
- pCallbacks->ErrorUnknownSubobject(SubobjectType);
- return E_INVALIDARG;
- }
- if (SubobjectSeen[D3DX12GetBaseSubobjectType(SubobjectType)])
- {
- pCallbacks->ErrorDuplicateSubobject(SubobjectType);
- return E_INVALIDARG; // disallow subobject duplicates in a stream
- }
- SubobjectSeen[SubobjectType] = true;
- switch (SubobjectType)
- {
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE:
- pCallbacks->RootSignatureCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS:
- pCallbacks->VSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::VS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::VS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS:
- pCallbacks->PSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS:
- pCallbacks->DSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS:
- pCallbacks->HSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::HS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::HS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS:
- pCallbacks->GSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::GS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::GS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS:
- pCallbacks->CSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS:
- pCallbacks->ASCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::AS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::AS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS:
- pCallbacks->MSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::MS)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::MS);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT:
- pCallbacks->StreamOutputCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND:
- pCallbacks->BlendStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::BlendState)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::BlendState);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK:
- pCallbacks->SampleMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleMask)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleMask);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER:
- pCallbacks->RasterizerStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL:
- pCallbacks->DepthStencilStateCb(*reinterpret_cast<CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1:
- pCallbacks->DepthStencilState1Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2:
- pCallbacks->DepthStencilState2Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT:
- pCallbacks->InputLayoutCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::InputLayout)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::InputLayout);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE:
- pCallbacks->IBStripCutValueCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY:
- pCallbacks->PrimitiveTopologyTypeCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS:
- pCallbacks->RTVFormatsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT:
- pCallbacks->DSVFormatCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC:
- pCallbacks->SampleDescCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK:
- pCallbacks->NodeMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::NodeMask)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::NodeMask);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO:
- pCallbacks->CachedPSOCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS:
- pCallbacks->FlagsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::Flags)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::Flags);
- break;
- case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING:
- pCallbacks->ViewInstancingCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc)*>(pStream));
- SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc);
- break;
- default:
- pCallbacks->ErrorUnknownSubobject(SubobjectType);
- return E_INVALIDARG;
- }
- }
-
- return S_OK;
-}
-
-//------------------------------------------------------------------------------------------------
-inline bool operator==( const D3D12_CLEAR_VALUE &a, const D3D12_CLEAR_VALUE &b) noexcept
-{
- if (a.Format != b.Format) return false;
- if (a.Format == DXGI_FORMAT_D24_UNORM_S8_UINT
- || a.Format == DXGI_FORMAT_D16_UNORM
- || a.Format == DXGI_FORMAT_D32_FLOAT
- || a.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT)
- {
- return (a.DepthStencil.Depth == b.DepthStencil.Depth) &&
- (a.DepthStencil.Stencil == b.DepthStencil.Stencil);
- } else {
- return (a.Color[0] == b.Color[0]) &&
- (a.Color[1] == b.Color[1]) &&
- (a.Color[2] == b.Color[2]) &&
- (a.Color[3] == b.Color[3]);
- }
-}
-inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &b) noexcept
-{
- return a.ClearValue == b.ClearValue;
-}
-inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &a, const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &b) noexcept
-{
- if (a.pSrcResource != b.pSrcResource) return false;
- if (a.pDstResource != b.pDstResource) return false;
- if (a.SubresourceCount != b.SubresourceCount) return false;
- if (a.Format != b.Format) return false;
- if (a.ResolveMode != b.ResolveMode) return false;
- if (a.PreserveResolveSource != b.PreserveResolveSource) return false;
- return true;
-}
-inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS &b) noexcept
-{
- if (a.Type != b.Type) return false;
- if (a.Type == D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR && !(a.Clear == b.Clear)) return false;
- return true;
-}
-inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS &a, const D3D12_RENDER_PASS_ENDING_ACCESS &b) noexcept
-{
- if (a.Type != b.Type) return false;
- if (a.Type == D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE && !(a.Resolve == b.Resolve)) return false;
- return true;
-}
-inline bool operator==( const D3D12_RENDER_PASS_RENDER_TARGET_DESC &a, const D3D12_RENDER_PASS_RENDER_TARGET_DESC &b) noexcept
-{
- if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false;
- if (!(a.BeginningAccess == b.BeginningAccess)) return false;
- if (!(a.EndingAccess == b.EndingAccess)) return false;
- return true;
-}
-inline bool operator==( const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &a, const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &b) noexcept
-{
- if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false;
- if (!(a.DepthBeginningAccess == b.DepthBeginningAccess)) return false;
- if (!(a.StencilBeginningAccess == b.StencilBeginningAccess)) return false;
- if (!(a.DepthEndingAccess == b.DepthEndingAccess)) return false;
- if (!(a.StencilEndingAccess == b.StencilEndingAccess)) return false;
- return true;
-}
-
-
-#ifndef D3DX12_NO_STATE_OBJECT_HELPERS
-
-//================================================================================================
-// D3DX12 State Object Creation Helpers
-//
-// Helper classes for creating new style state objects out of an arbitrary set of subobjects.
-// Uses STL
-//
-// Start by instantiating CD3DX12_STATE_OBJECT_DESC (see its public methods).
-// One of its methods is CreateSubobject(), which has a comment showing a couple of options for
-// defining subobjects using the helper classes for each subobject (CD3DX12_DXIL_LIBRARY_SUBOBJECT
-// etc.). The subobject helpers each have methods specific to the subobject for configuring its
-// contents.
-//
-//================================================================================================
-#include <list>
-#include <memory>
-#include <string>
-#include <vector>
-#ifndef D3DX12_USE_ATL
-#include <wrl/client.h>
-#define D3DX12_COM_PTR Microsoft::WRL::ComPtr
-#define D3DX12_COM_PTR_GET(x) x.Get()
-#define D3DX12_COM_PTR_ADDRESSOF(x) x.GetAddressOf()
-#else
-#include <atlbase.h>
-#define D3DX12_COM_PTR ATL::CComPtr
-#define D3DX12_COM_PTR_GET(x) x.p
-#define D3DX12_COM_PTR_ADDRESSOF(x) &x.p
-#endif
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_STATE_OBJECT_DESC
-{
-public:
- CD3DX12_STATE_OBJECT_DESC() noexcept
- {
- Init(D3D12_STATE_OBJECT_TYPE_COLLECTION);
- }
- CD3DX12_STATE_OBJECT_DESC(D3D12_STATE_OBJECT_TYPE Type) noexcept
- {
- Init(Type);
- }
- void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) noexcept { m_Desc.Type = Type; }
- operator const D3D12_STATE_OBJECT_DESC&()
- {
- // Do final preparation work
- m_RepointedAssociations.clear();
- m_SubobjectArray.clear();
- m_SubobjectArray.reserve(m_Desc.NumSubobjects);
- // Flatten subobjects into an array (each flattened subobject still has a
- // member that's a pointer to its desc that's not flattened)
- for (auto Iter = m_SubobjectList.begin();
- Iter != m_SubobjectList.end(); Iter++)
- {
- m_SubobjectArray.push_back(*Iter);
- // Store new location in array so we can redirect pointers contained in subobjects
- Iter->pSubobjectArrayLocation = &m_SubobjectArray.back();
- }
- // For subobjects with pointer fields, create a new copy of those subobject definitions
- // with fixed pointers
- for (UINT i = 0; i < m_Desc.NumSubobjects; i++)
- {
- if (m_SubobjectArray[i].Type == D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION)
- {
- auto pOriginalSubobjectAssociation =
- static_cast<const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION*>(m_SubobjectArray[i].pDesc);
- D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION Repointed = *pOriginalSubobjectAssociation;
- auto pWrapper =
- static_cast<const SUBOBJECT_WRAPPER*>(pOriginalSubobjectAssociation->pSubobjectToAssociate);
- Repointed.pSubobjectToAssociate = pWrapper->pSubobjectArrayLocation;
- m_RepointedAssociations.push_back(Repointed);
- m_SubobjectArray[i].pDesc = &m_RepointedAssociations.back();
- }
- }
- // Below: using ugly way to get pointer in case .data() is not defined
- m_Desc.pSubobjects = m_Desc.NumSubobjects ? &m_SubobjectArray[0] : nullptr;
- return m_Desc;
- }
- operator const D3D12_STATE_OBJECT_DESC*()
- {
- // Cast calls the above final preparation work
- return &static_cast<const D3D12_STATE_OBJECT_DESC&>(*this);
- }
-
- // CreateSubobject creates a sububject helper (e.g. CD3DX12_HIT_GROUP_SUBOBJECT)
- // whose lifetime is owned by this class.
- // e.g.
- //
- // CD3DX12_STATE_OBJECT_DESC Collection1(D3D12_STATE_OBJECT_TYPE_COLLECTION);
- // auto Lib0 = Collection1.CreateSubobject<CD3DX12_DXIL_LIBRARY_SUBOBJECT>();
- // Lib0->SetDXILLibrary(&pMyAppDxilLibs[0]);
- // Lib0->DefineExport(L"rayGenShader0"); // in practice these export listings might be
- // // data/engine driven
- // etc.
- //
- // Alternatively, users can instantiate sububject helpers explicitly, such as via local
- // variables instead, passing the state object desc that should point to it into the helper
- // constructor (or call mySubobjectHelper.AddToStateObject(Collection1)).
- // In this alternative scenario, the user must keep the subobject alive as long as the state
- // object it is associated with is alive, else its pointer references will be stale.
- // e.g.
- //
- // CD3DX12_STATE_OBJECT_DESC RaytracingState2(D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE);
- // CD3DX12_DXIL_LIBRARY_SUBOBJECT LibA(RaytracingState2);
- // LibA.SetDXILLibrary(&pMyAppDxilLibs[4]); // not manually specifying exports
- // // - meaning all exports in the libraries
- // // are exported
- // etc.
-
- template<typename T>
- T* CreateSubobject()
- {
- T* pSubobject = new T(*this);
- m_OwnedSubobjectHelpers.emplace_back(pSubobject);
- return pSubobject;
- }
-
-private:
- D3D12_STATE_SUBOBJECT* TrackSubobject(D3D12_STATE_SUBOBJECT_TYPE Type, void* pDesc)
- {
- SUBOBJECT_WRAPPER Subobject;
- Subobject.pSubobjectArrayLocation = nullptr;
- Subobject.Type = Type;
- Subobject.pDesc = pDesc;
- m_SubobjectList.push_back(Subobject);
- m_Desc.NumSubobjects++;
- return &m_SubobjectList.back();
- }
- void Init(D3D12_STATE_OBJECT_TYPE Type) noexcept
- {
- SetStateObjectType(Type);
- m_Desc.pSubobjects = nullptr;
- m_Desc.NumSubobjects = 0;
- m_SubobjectList.clear();
- m_SubobjectArray.clear();
- m_RepointedAssociations.clear();
- }
- typedef struct SUBOBJECT_WRAPPER : public D3D12_STATE_SUBOBJECT
- {
- D3D12_STATE_SUBOBJECT* pSubobjectArrayLocation; // new location when flattened into array
- // for repointing pointers in subobjects
- } SUBOBJECT_WRAPPER;
- D3D12_STATE_OBJECT_DESC m_Desc;
- std::list<SUBOBJECT_WRAPPER> m_SubobjectList; // Pointers to list nodes handed out so
- // these can be edited live
- std::vector<D3D12_STATE_SUBOBJECT> m_SubobjectArray; // Built at the end, copying list contents
-
- std::list<D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION>
- m_RepointedAssociations; // subobject type that contains pointers to other subobjects,
- // repointed to flattened array
-
- class StringContainer
- {
- public:
- LPCWSTR LocalCopy(LPCWSTR string, bool bSingleString = false)
- {
- if (string)
- {
- if (bSingleString)
- {
- m_Strings.clear();
- m_Strings.push_back(string);
- }
- else
- {
- m_Strings.push_back(string);
- }
- return m_Strings.back().c_str();
- }
- else
- {
- return nullptr;
- }
- }
- void clear() noexcept { m_Strings.clear(); }
- private:
- std::list<std::wstring> m_Strings;
- };
-
- class SUBOBJECT_HELPER_BASE
- {
- public:
- SUBOBJECT_HELPER_BASE() noexcept { Init(); }
- virtual ~SUBOBJECT_HELPER_BASE() = default;
- virtual D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept = 0;
- void AddToStateObject(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- m_pSubobject = ContainingStateObject.TrackSubobject(Type(), Data());
- }
- protected:
- virtual void* Data() noexcept = 0;
- void Init() noexcept { m_pSubobject = nullptr; }
- D3D12_STATE_SUBOBJECT* m_pSubobject;
- };
-
-#if(__cplusplus >= 201103L)
- std::list<std::unique_ptr<const SUBOBJECT_HELPER_BASE>> m_OwnedSubobjectHelpers;
-#else
- class OWNED_HELPER
- {
- public:
- OWNED_HELPER(const SUBOBJECT_HELPER_BASE* pHelper) noexcept { m_pHelper = pHelper; }
- ~OWNED_HELPER() { delete m_pHelper; }
- const SUBOBJECT_HELPER_BASE* m_pHelper;
- };
-
- std::list<OWNED_HELPER> m_OwnedSubobjectHelpers;
-#endif
-
- friend class CD3DX12_DXIL_LIBRARY_SUBOBJECT;
- friend class CD3DX12_EXISTING_COLLECTION_SUBOBJECT;
- friend class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT;
- friend class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
- friend class CD3DX12_HIT_GROUP_SUBOBJECT;
- friend class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT;
- friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT;
- friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT;
- friend class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT;
- friend class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT;
- friend class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT;
- friend class CD3DX12_NODE_MASK_SUBOBJECT;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_DXIL_LIBRARY_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_DXIL_LIBRARY_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_DXIL_LIBRARY_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetDXILLibrary(const D3D12_SHADER_BYTECODE* pCode) noexcept
- {
- static const D3D12_SHADER_BYTECODE Default = {};
- m_Desc.DXILLibrary = pCode ? *pCode : Default;
- }
- void DefineExport(
- LPCWSTR Name,
- LPCWSTR ExportToRename = nullptr,
- D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE)
- {
- D3D12_EXPORT_DESC Export;
- Export.Name = m_Strings.LocalCopy(Name);
- Export.ExportToRename = m_Strings.LocalCopy(ExportToRename);
- Export.Flags = Flags;
- m_Exports.push_back(Export);
- m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
- m_Desc.NumExports = static_cast<UINT>(m_Exports.size());
- }
- template<size_t N>
- void DefineExports(LPCWSTR(&Exports)[N])
- {
- for (UINT i = 0; i < N; i++)
- {
- DefineExport(Exports[i]);
- }
- }
- void DefineExports(const LPCWSTR* Exports, UINT N)
- {
- for (UINT i = 0; i < N; i++)
- {
- DefineExport(Exports[i]);
- }
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_DXIL_LIBRARY_DESC&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- m_Strings.clear();
- m_Exports.clear();
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_DXIL_LIBRARY_DESC m_Desc;
- CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
- std::vector<D3D12_EXPORT_DESC> m_Exports;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_EXISTING_COLLECTION_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_EXISTING_COLLECTION_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_EXISTING_COLLECTION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetExistingCollection(ID3D12StateObject*pExistingCollection) noexcept
- {
- m_Desc.pExistingCollection = pExistingCollection;
- m_CollectionRef = pExistingCollection;
- }
- void DefineExport(
- LPCWSTR Name,
- LPCWSTR ExportToRename = nullptr,
- D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE)
- {
- D3D12_EXPORT_DESC Export;
- Export.Name = m_Strings.LocalCopy(Name);
- Export.ExportToRename = m_Strings.LocalCopy(ExportToRename);
- Export.Flags = Flags;
- m_Exports.push_back(Export);
- m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
- m_Desc.NumExports = static_cast<UINT>(m_Exports.size());
- }
- template<size_t N>
- void DefineExports(LPCWSTR(&Exports)[N])
- {
- for (UINT i = 0; i < N; i++)
- {
- DefineExport(Exports[i]);
- }
- }
- void DefineExports(const LPCWSTR* Exports, UINT N)
- {
- for (UINT i = 0; i < N; i++)
- {
- DefineExport(Exports[i]);
- }
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_EXISTING_COLLECTION_DESC&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- m_CollectionRef = nullptr;
- m_Strings.clear();
- m_Exports.clear();
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_EXISTING_COLLECTION_DESC m_Desc;
- D3DX12_COM_PTR<ID3D12StateObject> m_CollectionRef;
- CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
- std::vector<D3D12_EXPORT_DESC> m_Exports;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAssociate) noexcept
- {
- m_Desc.pSubobjectToAssociate = &SubobjectToAssociate;
- }
- void AddExport(LPCWSTR Export)
- {
- m_Desc.NumExports++;
- m_Exports.push_back(m_Strings.LocalCopy(Export));
- m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
- }
- template<size_t N>
- void AddExports(LPCWSTR (&Exports)[N])
- {
- for (UINT i = 0; i < N; i++)
- {
- AddExport(Exports[i]);
- }
- }
- void AddExports(const LPCWSTR* Exports, UINT N)
- {
- for (UINT i = 0; i < N; i++)
- {
- AddExport(Exports[i]);
- }
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- m_Strings.clear();
- m_Exports.clear();
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc;
- CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
- std::vector<LPCWSTR> m_Exports;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION() noexcept
- {
- Init();
- }
- CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate)
- {
- m_Desc.SubobjectToAssociate = m_SubobjectName.LocalCopy(SubobjectToAssociate, true);
- }
- void AddExport(LPCWSTR Export)
- {
- m_Desc.NumExports++;
- m_Exports.push_back(m_Strings.LocalCopy(Export));
- m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
- }
- template<size_t N>
- void AddExports(LPCWSTR (&Exports)[N])
- {
- for (UINT i = 0; i < N; i++)
- {
- AddExport(Exports[i]);
- }
- }
- void AddExports(const LPCWSTR* Exports, UINT N)
- {
- for (UINT i = 0; i < N; i++)
- {
- AddExport(Exports[i]);
- }
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- m_Strings.clear();
- m_SubobjectName.clear();
- m_Exports.clear();
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc;
- CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
- CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName;
- std::vector<LPCWSTR> m_Exports;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_HIT_GROUP_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_HIT_GROUP_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_HIT_GROUP_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetHitGroupExport(LPCWSTR exportName)
- {
- m_Desc.HitGroupExport = m_Strings[0].LocalCopy(exportName, true);
- }
- void SetHitGroupType(D3D12_HIT_GROUP_TYPE Type) noexcept { m_Desc.Type = Type; }
- void SetAnyHitShaderImport(LPCWSTR importName)
- {
- m_Desc.AnyHitShaderImport = m_Strings[1].LocalCopy(importName, true);
- }
- void SetClosestHitShaderImport(LPCWSTR importName)
- {
- m_Desc.ClosestHitShaderImport = m_Strings[2].LocalCopy(importName, true);
- }
- void SetIntersectionShaderImport(LPCWSTR importName)
- {
- m_Desc.IntersectionShaderImport = m_Strings[3].LocalCopy(importName, true);
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_HIT_GROUP_DESC&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- for (UINT i = 0; i < m_NumStrings; i++)
- {
- m_Strings[i].clear();
- }
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_HIT_GROUP_DESC m_Desc;
- static constexpr UINT m_NumStrings = 4;
- CD3DX12_STATE_OBJECT_DESC::StringContainer
- m_Strings[m_NumStrings]; // one string for every entrypoint name
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes) noexcept
- {
- m_Desc.MaxPayloadSizeInBytes = MaxPayloadSizeInBytes;
- m_Desc.MaxAttributeSizeInBytes = MaxAttributeSizeInBytes;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_RAYTRACING_SHADER_CONFIG&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_RAYTRACING_SHADER_CONFIG m_Desc;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void Config(UINT MaxTraceRecursionDepth) noexcept
- {
- m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_RAYTRACING_PIPELINE_CONFIG&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_RAYTRACING_PIPELINE_CONFIG m_Desc;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS Flags) noexcept
- {
- m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth;
- m_Desc.Flags = Flags;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_RAYTRACING_PIPELINE_CONFIG1&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_RAYTRACING_PIPELINE_CONFIG1 m_Desc;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept
- {
- m_pRootSig = pRootSig;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_pRootSig = nullptr;
- }
- void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); }
- D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept
- {
- m_pRootSig = pRootSig;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_pRootSig = nullptr;
- }
- void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); }
- D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags) noexcept
- {
- m_Desc.Flags = Flags;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_STATE_OBJECT_CONFIG&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_STATE_OBJECT_CONFIG m_Desc;
-};
-
-//------------------------------------------------------------------------------------------------
-class CD3DX12_NODE_MASK_SUBOBJECT
- : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
-{
-public:
- CD3DX12_NODE_MASK_SUBOBJECT() noexcept
- {
- Init();
- }
- CD3DX12_NODE_MASK_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
- {
- Init();
- AddToStateObject(ContainingStateObject);
- }
- void SetNodeMask(UINT NodeMask) noexcept
- {
- m_Desc.NodeMask = NodeMask;
- }
- D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
- {
- return D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK;
- }
- operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
- operator const D3D12_NODE_MASK&() const noexcept { return m_Desc; }
-private:
- void Init() noexcept
- {
- SUBOBJECT_HELPER_BASE::Init();
- m_Desc = {};
- }
- void* Data() noexcept override { return &m_Desc; }
- D3D12_NODE_MASK m_Desc;
-};
-
-#endif // !D3DX12_NO_STATE_OBJECT_HELPERS
-
-
-//================================================================================================
-// D3DX12 Enhanced Barrier Helpers
-//================================================================================================
-
-class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE
-{
-public:
- CD3DX12_BARRIER_SUBRESOURCE_RANGE() = default;
- CD3DX12_BARRIER_SUBRESOURCE_RANGE(const D3D12_BARRIER_SUBRESOURCE_RANGE &o) noexcept :
- D3D12_BARRIER_SUBRESOURCE_RANGE(o)
- {}
- explicit CD3DX12_BARRIER_SUBRESOURCE_RANGE(UINT Subresource) noexcept :
- D3D12_BARRIER_SUBRESOURCE_RANGE{ Subresource, 0, 0, 0, 0, 0 }
- {}
- CD3DX12_BARRIER_SUBRESOURCE_RANGE(
- UINT FirstMipLevel,
- UINT NumMips,
- UINT FirstArraySlice,
- UINT NumArraySlices,
- UINT FirstPlane = 0,
- UINT NumPlanes = 1) noexcept :
- D3D12_BARRIER_SUBRESOURCE_RANGE
- {
- FirstMipLevel,
- NumMips,
- FirstArraySlice,
- NumArraySlices,
- FirstPlane,
- NumPlanes
- }
- {}
-};
-
-class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER
-{
-public:
- CD3DX12_GLOBAL_BARRIER() = default;
- CD3DX12_GLOBAL_BARRIER(const D3D12_GLOBAL_BARRIER &o) noexcept : D3D12_GLOBAL_BARRIER(o){}
- CD3DX12_GLOBAL_BARRIER(
- D3D12_BARRIER_SYNC syncBefore,
- D3D12_BARRIER_SYNC syncAfter,
- D3D12_BARRIER_ACCESS accessBefore,
- D3D12_BARRIER_ACCESS accessAfter) noexcept : D3D12_GLOBAL_BARRIER {
- syncBefore,
- syncAfter,
- accessBefore,
- accessAfter
- }
- {}
-};
-
-class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER
-{
-public:
- CD3DX12_BUFFER_BARRIER() = default;
- CD3DX12_BUFFER_BARRIER(const D3D12_BUFFER_BARRIER &o) noexcept : D3D12_BUFFER_BARRIER(o){}
- CD3DX12_BUFFER_BARRIER(
- D3D12_BARRIER_SYNC syncBefore,
- D3D12_BARRIER_SYNC syncAfter,
- D3D12_BARRIER_ACCESS accessBefore,
- D3D12_BARRIER_ACCESS accessAfter,
- ID3D12Resource *pRes) noexcept : D3D12_BUFFER_BARRIER {
- syncBefore,
- syncAfter,
- accessBefore,
- accessAfter,
- pRes,
- 0, ULLONG_MAX
- }
- {}
-};
-
-class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER
-{
-public:
- CD3DX12_TEXTURE_BARRIER() = default;
- CD3DX12_TEXTURE_BARRIER(const D3D12_TEXTURE_BARRIER &o) noexcept : D3D12_TEXTURE_BARRIER(o){}
- CD3DX12_TEXTURE_BARRIER(
- D3D12_BARRIER_SYNC syncBefore,
- D3D12_BARRIER_SYNC syncAfter,
- D3D12_BARRIER_ACCESS accessBefore,
- D3D12_BARRIER_ACCESS accessAfter,
- D3D12_BARRIER_LAYOUT layoutBefore,
- D3D12_BARRIER_LAYOUT layoutAfter,
- ID3D12Resource *pRes,
- const D3D12_BARRIER_SUBRESOURCE_RANGE &subresources,
- D3D12_TEXTURE_BARRIER_FLAGS flag = D3D12_TEXTURE_BARRIER_FLAG_NONE) noexcept : D3D12_TEXTURE_BARRIER {
- syncBefore,
- syncAfter,
- accessBefore,
- accessAfter,
- layoutBefore,
- layoutAfter,
- pRes,
- subresources,
- flag
- }
- {}
-};
-
-class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP
-{
-public:
- CD3DX12_BARRIER_GROUP() = default;
- CD3DX12_BARRIER_GROUP(const D3D12_BARRIER_GROUP &o) noexcept : D3D12_BARRIER_GROUP(o){}
- CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_BUFFER_BARRIER *pBarriers) noexcept
- {
- Type = D3D12_BARRIER_TYPE_BUFFER;
- NumBarriers = numBarriers;
- pBufferBarriers = pBarriers;
- }
- CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_TEXTURE_BARRIER *pBarriers) noexcept
- {
- Type = D3D12_BARRIER_TYPE_TEXTURE;
- NumBarriers = numBarriers;
- pTextureBarriers = pBarriers;
- }
- CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_GLOBAL_BARRIER *pBarriers) noexcept
- {
- Type = D3D12_BARRIER_TYPE_GLOBAL;
- NumBarriers = numBarriers;
- pGlobalBarriers = pBarriers;
- }
-};
-
-
-#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
-
-//================================================================================================
-// D3DX12 Check Feature Support
-//================================================================================================
-
-#include <vector>
-
-class CD3DX12FeatureSupport
-{
-public: // Function declaration
- // Default constructor that creates an empty object
- CD3DX12FeatureSupport() noexcept;
-
- // Initialize data from the given device
- HRESULT Init(ID3D12Device* pDevice);
-
- // Retreives the status of the object. If an error occurred in the initialization process, the function returns the error code.
- HRESULT GetStatus() const noexcept { return m_hStatus; }
-
- // Getter functions for each feature class
- // D3D12_OPTIONS
- BOOL DoublePrecisionFloatShaderOps() const noexcept;
- BOOL OutputMergerLogicOp() const noexcept;
- D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport() const noexcept;
- D3D12_TILED_RESOURCES_TIER TiledResourcesTier() const noexcept;
- D3D12_RESOURCE_BINDING_TIER ResourceBindingTier() const noexcept;
- BOOL PSSpecifiedStencilRefSupported() const noexcept;
- BOOL TypedUAVLoadAdditionalFormats() const noexcept;
- BOOL ROVsSupported() const noexcept;
- D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier() const noexcept;
- BOOL StandardSwizzle64KBSupported() const noexcept;
- BOOL CrossAdapterRowMajorTextureSupported() const noexcept;
- BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation() const noexcept;
- D3D12_RESOURCE_HEAP_TIER ResourceHeapTier() const noexcept;
- D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier() const noexcept;
- UINT MaxGPUVirtualAddressBitsPerResource() const noexcept;
-
- // FEATURE_LEVELS
- D3D_FEATURE_LEVEL MaxSupportedFeatureLevel() const noexcept;
-
- // FORMAT_SUPPORT
- HRESULT FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const;
-
- // MUTLTISAMPLE_QUALITY_LEVELS
- HRESULT MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const;
-
- // FORMAT_INFO
- HRESULT FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const;
-
- // GPU_VIRTUAL_ADDRESS_SUPPORT
- UINT MaxGPUVirtualAddressBitsPerProcess() const noexcept;
-
- // SHADER_MODEL
- D3D_SHADER_MODEL HighestShaderModel() const noexcept;
-
- // D3D12_OPTIONS1
- BOOL WaveOps() const noexcept;
- UINT WaveLaneCountMin() const noexcept;
- UINT WaveLaneCountMax() const noexcept;
- UINT TotalLaneCount() const noexcept;
- BOOL ExpandedComputeResourceStates() const noexcept;
- BOOL Int64ShaderOps() const noexcept;
-
- // PROTECTED_RESOURCE_SESSION_SUPPORT
- D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ProtectedResourceSessionSupport(UINT NodeIndex = 0) const;
-
- // ROOT_SIGNATURE
- D3D_ROOT_SIGNATURE_VERSION HighestRootSignatureVersion() const noexcept;
-
- // ARCHITECTURE1
- BOOL TileBasedRenderer(UINT NodeIndex = 0) const;
- BOOL UMA(UINT NodeIndex = 0) const;
- BOOL CacheCoherentUMA(UINT NodeIndex = 0) const;
- BOOL IsolatedMMU(UINT NodeIndex = 0) const;
-
- // D3D12_OPTIONS2
- BOOL DepthBoundsTestSupported() const noexcept;
- D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const noexcept;
-
- // SHADER_CACHE
- D3D12_SHADER_CACHE_SUPPORT_FLAGS ShaderCacheSupportFlags() const noexcept;
-
- // COMMAND_QUEUE_PRIORITY
- BOOL CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority);
-
- // D3D12_OPTIONS3
- BOOL CopyQueueTimestampQueriesSupported() const noexcept;
- BOOL CastingFullyTypedFormatSupported() const noexcept;
- D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags() const noexcept;
- D3D12_VIEW_INSTANCING_TIER ViewInstancingTier() const noexcept;
- BOOL BarycentricsSupported() const noexcept;
-
- // EXISTING_HEAPS
- BOOL ExistingHeapsSupported() const noexcept;
-
- // D3D12_OPTIONS4
- BOOL MSAA64KBAlignedTextureSupported() const noexcept;
- D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier() const noexcept;
- BOOL Native16BitShaderOpsSupported() const noexcept;
-
- // SERIALIZATION
- D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier(UINT NodeIndex = 0) const;
-
- // CROSS_NODE
- // CrossNodeSharingTier handled in D3D12Options
- BOOL CrossNodeAtomicShaderInstructions() const noexcept;
-
- // D3D12_OPTIONS5
- BOOL SRVOnlyTiledResourceTier3() const noexcept;
- D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept;
- D3D12_RAYTRACING_TIER RaytracingTier() const noexcept;
-
- // DISPLAYABLE
- BOOL DisplayableTexture() const noexcept;
- // SharedResourceCompatibilityTier handled in D3D12Options4
-
- // D3D12_OPTIONS6
- BOOL AdditionalShadingRatesSupported() const noexcept;
- BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing() const noexcept;
- D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier() const noexcept;
- UINT ShadingRateImageTileSize() const noexcept;
- BOOL BackgroundProcessingSupported() const noexcept;
-
- // QUERY_META_COMMAND
- HRESULT QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const;
-
- // D3D12_OPTIONS7
- D3D12_MESH_SHADER_TIER MeshShaderTier() const noexcept;
- D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier() const noexcept;
-
- // PROTECTED_RESOURCE_SESSION_TYPE_COUNT
- UINT ProtectedResourceSessionTypeCount(UINT NodeIndex = 0) const;
-
- // PROTECTED_RESOURCE_SESSION_TYPES
- std::vector<GUID> ProtectedResourceSessionTypes(UINT NodeIndex = 0) const;
-
- // D3D12_OPTIONS8
- BOOL UnalignedBlockTexturesSupported() const noexcept;
-
- // D3D12_OPTIONS9
- BOOL MeshShaderPipelineStatsSupported() const noexcept;
- BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex() const noexcept;
- BOOL AtomicInt64OnTypedResourceSupported() const noexcept;
- BOOL AtomicInt64OnGroupSharedSupported() const noexcept;
- BOOL DerivativesInMeshAndAmplificationShadersSupported() const noexcept;
- D3D12_WAVE_MMA_TIER WaveMMATier() const noexcept;
-
- // D3D12_OPTIONS10
- BOOL VariableRateShadingSumCombinerSupported() const noexcept;
- BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept;
-
- // D3D12_OPTIONS11
- BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept;
-
- // D3D12_OPTIONS12
- D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives() const noexcept;
- BOOL EnhancedBarriersSupported() const noexcept;
- BOOL RelaxedFormatCastingSupported() const noexcept;
-
- // D3D12_OPTIONS13
- BOOL UnrestrictedBufferTextureCopyPitchSupported() const noexcept;
- BOOL UnrestrictedVertexElementAlignmentSupported() const noexcept;
- BOOL InvertedViewportHeightFlipsYSupported() const noexcept;
- BOOL InvertedViewportDepthFlipsZSupported() const noexcept;
- BOOL TextureCopyBetweenDimensionsSupported() const noexcept;
- BOOL AlphaBlendFactorSupported() const noexcept;
-
- // D3D12_OPTIONS14
- BOOL AdvancedTextureOpsSupported() const noexcept;
- BOOL WriteableMSAATexturesSupported() const noexcept;
- BOOL IndependentFrontAndBackStencilRefMaskSupported() const noexcept;
-
- // D3D12_OPTIONS15
- BOOL TriangleFanSupported() const noexcept;
- BOOL DynamicIndexBufferStripCutSupported() const noexcept;
-
-private: // Private structs and helpers declaration
- struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES
- {
- std::vector<GUID> TypeVec;
- };
-
- // Helper function to decide the highest shader model supported by the system
- // Stores the result in m_dShaderModel
- // Must be updated whenever a new shader model is added to the d3d12.h header
- HRESULT QueryHighestShaderModel();
-
- // Helper function to decide the highest root signature supported
- // Must be updated whenever a new root signature version is added to the d3d12.h header
- HRESULT QueryHighestRootSignatureVersion();
-
- // Helper funcion to decide the highest feature level
- HRESULT QueryHighestFeatureLevel();
-
- // Helper function to initialize local protected resource session types structs
- HRESULT QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count);
-
-private: // Member data
- // Pointer to the underlying device
- ID3D12Device* m_pDevice;
-
- // Stores the error code from initialization
- HRESULT m_hStatus;
-
- // Feature support data structs
- D3D12_FEATURE_DATA_D3D12_OPTIONS m_dOptions;
- D3D_FEATURE_LEVEL m_eMaxFeatureLevel;
- D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT m_dGPUVASupport;
- D3D12_FEATURE_DATA_SHADER_MODEL m_dShaderModel;
- D3D12_FEATURE_DATA_D3D12_OPTIONS1 m_dOptions1;
- std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT> m_dProtectedResourceSessionSupport;
- D3D12_FEATURE_DATA_ROOT_SIGNATURE m_dRootSignature;
- std::vector<D3D12_FEATURE_DATA_ARCHITECTURE1> m_dArchitecture1;
- D3D12_FEATURE_DATA_D3D12_OPTIONS2 m_dOptions2;
- D3D12_FEATURE_DATA_SHADER_CACHE m_dShaderCache;
- D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY m_dCommandQueuePriority;
- D3D12_FEATURE_DATA_D3D12_OPTIONS3 m_dOptions3;
- D3D12_FEATURE_DATA_EXISTING_HEAPS m_dExistingHeaps;
- D3D12_FEATURE_DATA_D3D12_OPTIONS4 m_dOptions4;
- std::vector<D3D12_FEATURE_DATA_SERIALIZATION> m_dSerialization; // Cat2 NodeIndex
- D3D12_FEATURE_DATA_CROSS_NODE m_dCrossNode;
- D3D12_FEATURE_DATA_D3D12_OPTIONS5 m_dOptions5;
- D3D12_FEATURE_DATA_DISPLAYABLE m_dDisplayable;
- D3D12_FEATURE_DATA_D3D12_OPTIONS6 m_dOptions6;
- D3D12_FEATURE_DATA_D3D12_OPTIONS7 m_dOptions7;
- std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT> m_dProtectedResourceSessionTypeCount; // Cat2 NodeIndex
- std::vector<ProtectedResourceSessionTypesLocal> m_dProtectedResourceSessionTypes; // Cat3
- D3D12_FEATURE_DATA_D3D12_OPTIONS8 m_dOptions8;
- D3D12_FEATURE_DATA_D3D12_OPTIONS9 m_dOptions9;
- D3D12_FEATURE_DATA_D3D12_OPTIONS10 m_dOptions10;
- D3D12_FEATURE_DATA_D3D12_OPTIONS11 m_dOptions11;
- D3D12_FEATURE_DATA_D3D12_OPTIONS12 m_dOptions12;
- D3D12_FEATURE_DATA_D3D12_OPTIONS13 m_dOptions13;
- D3D12_FEATURE_DATA_D3D12_OPTIONS14 m_dOptions14;
- D3D12_FEATURE_DATA_D3D12_OPTIONS15 m_dOptions15;
-};
-
-// Implementations for CD3DX12FeatureSupport functions
-
-// Macro to set up a getter function for each entry in feature support data
-// The getter function will have the same name as the feature option name
-#define FEATURE_SUPPORT_GET(RETTYPE,FEATURE,OPTION) \
-inline RETTYPE CD3DX12FeatureSupport::OPTION() const noexcept \
-{ \
- return FEATURE.OPTION; \
-}
-
-// Macro to set up a getter function for each entry in feature support data
-// Also specifies the name for the function which can be different from the feature name
-#define FEATURE_SUPPORT_GET_NAME(RETTYPE,FEATURE,OPTION,NAME) \
-inline RETTYPE CD3DX12FeatureSupport::NAME() const noexcept \
-{\
- return FEATURE.OPTION; \
-}
-
-// Macro to set up a getter function for feature data indexed by the graphics node ID
-// The default parameter is 0, or the first availabe graphics device node
-#define FEATURE_SUPPORT_GET_NODE_INDEXED(RETTYPE,FEATURE,OPTION) \
-inline RETTYPE CD3DX12FeatureSupport::OPTION(UINT NodeIndex) const \
-{\
- return FEATURE[NodeIndex].OPTION; \
-}
-
-// Macro to set up a getter function for feature data indexed by NodeIndex
-// Allows a custom name for the getter function
-#define FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(RETTYPE,FEATURE,OPTION,NAME) \
-inline RETTYPE CD3DX12FeatureSupport::NAME(UINT NodeIndex) const \
-{\
- return FEATURE[NodeIndex].OPTION; \
-}
-
-inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept
-: m_pDevice(nullptr)
-, m_hStatus(E_INVALIDARG)
-, m_dOptions{}
-, m_eMaxFeatureLevel{}
-, m_dGPUVASupport{}
-, m_dShaderModel{}
-, m_dOptions1{}
-, m_dRootSignature{}
-, m_dOptions2{}
-, m_dShaderCache{}
-, m_dCommandQueuePriority{}
-, m_dOptions3{}
-, m_dExistingHeaps{}
-, m_dOptions4{}
-, m_dCrossNode{}
-, m_dOptions5{}
-, m_dDisplayable{}
-, m_dOptions6{}
-, m_dOptions7{}
-, m_dOptions8{}
-, m_dOptions9{}
-, m_dOptions10{}
-, m_dOptions11{}
-, m_dOptions12{}
-, m_dOptions13{}
-, m_dOptions14{}
-, m_dOptions15{}
-{}
-
-inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice)
-{
- if (!pDevice)
- {
- m_hStatus = E_INVALIDARG;
- return m_hStatus;
- }
-
- m_pDevice = pDevice;
-
- // Initialize static feature support data structures
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_dOptions, sizeof(m_dOptions))))
- {
- m_dOptions.DoublePrecisionFloatShaderOps = false;
- m_dOptions.OutputMergerLogicOp = false;
- m_dOptions.MinPrecisionSupport = D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE;
- m_dOptions.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED;
- m_dOptions.ResourceBindingTier = static_cast<D3D12_RESOURCE_BINDING_TIER>(0);
- m_dOptions.PSSpecifiedStencilRefSupported = false;
- m_dOptions.TypedUAVLoadAdditionalFormats = false;
- m_dOptions.ROVsSupported = false;
- m_dOptions.ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED;
- m_dOptions.MaxGPUVirtualAddressBitsPerResource = 0;
- m_dOptions.StandardSwizzle64KBSupported = false;
- m_dOptions.CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED;
- m_dOptions.CrossAdapterRowMajorTextureSupported = false;
- m_dOptions.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = false;
- m_dOptions.ResourceHeapTier = static_cast<D3D12_RESOURCE_HEAP_TIER>(0);
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT, &m_dGPUVASupport, sizeof(m_dGPUVASupport))))
- {
- m_dGPUVASupport.MaxGPUVirtualAddressBitsPerProcess = 0;
- m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource = 0;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &m_dOptions1, sizeof(m_dOptions1))))
- {
- m_dOptions1.WaveOps = false;
- m_dOptions1.WaveLaneCountMax = 0;
- m_dOptions1.WaveLaneCountMin = 0;
- m_dOptions1.TotalLaneCount = 0;
- m_dOptions1.ExpandedComputeResourceStates = 0;
- m_dOptions1.Int64ShaderOps = 0;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2, &m_dOptions2, sizeof(m_dOptions2))))
- {
- m_dOptions2.DepthBoundsTestSupported = false;
- m_dOptions2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_CACHE, &m_dShaderCache, sizeof(m_dShaderCache))))
- {
- m_dShaderCache.SupportFlags = D3D12_SHADER_CACHE_SUPPORT_NONE;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &m_dOptions3, sizeof(m_dOptions3))))
- {
- m_dOptions3.CopyQueueTimestampQueriesSupported = false;
- m_dOptions3.CastingFullyTypedFormatSupported = false;
- m_dOptions3.WriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE;
- m_dOptions3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED;
- m_dOptions3.BarycentricsSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_EXISTING_HEAPS, &m_dExistingHeaps, sizeof(m_dExistingHeaps))))
- {
- m_dExistingHeaps.Supported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &m_dOptions4, sizeof(m_dOptions4))))
- {
- m_dOptions4.MSAA64KBAlignedTextureSupported = false;
- m_dOptions4.Native16BitShaderOpsSupported = false;
- m_dOptions4.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_CROSS_NODE, &m_dCrossNode, sizeof(m_dCrossNode))))
- {
- m_dCrossNode.SharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED;
- m_dCrossNode.AtomicShaderInstructions = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &m_dOptions5, sizeof(m_dOptions5))))
- {
- m_dOptions5.SRVOnlyTiledResourceTier3 = false;
- m_dOptions5.RenderPassesTier = D3D12_RENDER_PASS_TIER_0;
- m_dOptions5.RaytracingTier = D3D12_RAYTRACING_TIER_NOT_SUPPORTED;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_DISPLAYABLE, &m_dDisplayable, sizeof(m_dDisplayable))))
- {
- m_dDisplayable.DisplayableTexture = false;
- m_dDisplayable.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &m_dOptions6, sizeof(m_dOptions6))))
- {
- m_dOptions6.AdditionalShadingRatesSupported = false;
- m_dOptions6.PerPrimitiveShadingRateSupportedWithViewportIndexing = false;
- m_dOptions6.VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED;
- m_dOptions6.ShadingRateImageTileSize = 0;
- m_dOptions6.BackgroundProcessingSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &m_dOptions7, sizeof(m_dOptions7))))
- {
- m_dOptions7.MeshShaderTier = D3D12_MESH_SHADER_TIER_NOT_SUPPORTED;
- m_dOptions7.SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &m_dOptions8, sizeof(m_dOptions8))))
- {
- m_dOptions8.UnalignedBlockTexturesSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS9, &m_dOptions9, sizeof(m_dOptions9))))
- {
- m_dOptions9.MeshShaderPipelineStatsSupported = false;
- m_dOptions9.MeshShaderSupportsFullRangeRenderTargetArrayIndex = false;
- m_dOptions9.AtomicInt64OnGroupSharedSupported = false;
- m_dOptions9.AtomicInt64OnTypedResourceSupported = false;
- m_dOptions9.DerivativesInMeshAndAmplificationShadersSupported = false;
- m_dOptions9.WaveMMATier = D3D12_WAVE_MMA_TIER_NOT_SUPPORTED;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS10, &m_dOptions10, sizeof(m_dOptions10))))
- {
- m_dOptions10.MeshShaderPerPrimitiveShadingRateSupported = false;
- m_dOptions10.VariableRateShadingSumCombinerSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS11, &m_dOptions11, sizeof(m_dOptions11))))
- {
- m_dOptions11.AtomicInt64OnDescriptorHeapResourceSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &m_dOptions12, sizeof(m_dOptions12))))
- {
- m_dOptions12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE::D3D12_TRI_STATE_UNKNOWN;
- m_dOptions12.EnhancedBarriersSupported = false;
- m_dOptions12.RelaxedFormatCastingSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS13, &m_dOptions13, sizeof(m_dOptions13))))
- {
- m_dOptions13.UnrestrictedBufferTextureCopyPitchSupported = false;
- m_dOptions13.UnrestrictedVertexElementAlignmentSupported = false;
- m_dOptions13.InvertedViewportHeightFlipsYSupported = false;
- m_dOptions13.InvertedViewportDepthFlipsZSupported = false;
- m_dOptions13.TextureCopyBetweenDimensionsSupported = false;
- m_dOptions13.AlphaBlendFactorSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &m_dOptions14, sizeof(m_dOptions14))))
- {
- m_dOptions14.AdvancedTextureOpsSupported = false;
- m_dOptions14.WriteableMSAATexturesSupported = false;
- m_dOptions14.IndependentFrontAndBackStencilRefMaskSupported = false;
- }
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS15, &m_dOptions15, sizeof(m_dOptions15))))
- {
- m_dOptions15.TriangleFanSupported = false;
- m_dOptions15.DynamicIndexBufferStripCutSupported = false;
- }
-
- // Initialize per-node feature support data structures
- const UINT uNodeCount = m_pDevice->GetNodeCount();
- m_dProtectedResourceSessionSupport.resize(uNodeCount);
- m_dArchitecture1.resize(uNodeCount);
- m_dSerialization.resize(uNodeCount);
- m_dProtectedResourceSessionTypeCount.resize(uNodeCount);
- m_dProtectedResourceSessionTypes.resize(uNodeCount);
- for (UINT NodeIndex = 0; NodeIndex < uNodeCount; NodeIndex++)
- {
- m_dProtectedResourceSessionSupport[NodeIndex].NodeIndex = NodeIndex;
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT, &m_dProtectedResourceSessionSupport[NodeIndex], sizeof(m_dProtectedResourceSessionSupport[NodeIndex]))))
- {
- m_dProtectedResourceSessionSupport[NodeIndex].Support = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE;
- }
-
- m_dArchitecture1[NodeIndex].NodeIndex = NodeIndex;
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1, &m_dArchitecture1[NodeIndex], sizeof(m_dArchitecture1[NodeIndex]))))
- {
- D3D12_FEATURE_DATA_ARCHITECTURE dArchLocal = {};
- dArchLocal.NodeIndex = NodeIndex;
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &dArchLocal, sizeof(dArchLocal))))
- {
- dArchLocal.TileBasedRenderer = false;
- dArchLocal.UMA = false;
- dArchLocal.CacheCoherentUMA = false;
- }
-
- m_dArchitecture1[NodeIndex].TileBasedRenderer = dArchLocal.TileBasedRenderer;
- m_dArchitecture1[NodeIndex].UMA = dArchLocal.UMA;
- m_dArchitecture1[NodeIndex].CacheCoherentUMA = dArchLocal.CacheCoherentUMA;
- m_dArchitecture1[NodeIndex].IsolatedMMU = false;
- }
-
- m_dSerialization[NodeIndex].NodeIndex = NodeIndex;
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SERIALIZATION, &m_dSerialization[NodeIndex], sizeof(m_dSerialization[NodeIndex]))))
- {
- m_dSerialization[NodeIndex].HeapSerializationTier = D3D12_HEAP_SERIALIZATION_TIER_0;
- }
-
- m_dProtectedResourceSessionTypeCount[NodeIndex].NodeIndex = NodeIndex;
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT, &m_dProtectedResourceSessionTypeCount[NodeIndex], sizeof(m_dProtectedResourceSessionTypeCount[NodeIndex]))))
- {
- m_dProtectedResourceSessionTypeCount[NodeIndex].Count = 0;
- }
-
- // Special procedure to initialize local protected resource session types structs
- // Must wait until session type count initialized
- QueryProtectedResourceSessionTypes(NodeIndex, m_dProtectedResourceSessionTypeCount[NodeIndex].Count);
- }
-
- // Initialize features that requires highest version check
- if (FAILED(m_hStatus = QueryHighestShaderModel()))
- {
- return m_hStatus;
- }
-
- if (FAILED(m_hStatus = QueryHighestRootSignatureVersion()))
- {
- return m_hStatus;
- }
-
- // Initialize Feature Levels data
- if (FAILED(m_hStatus = QueryHighestFeatureLevel()))
- {
- return m_hStatus;
- }
-
- return m_hStatus;
-}
-
-// 0: D3D12_OPTIONS
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, DoublePrecisionFloatShaderOps);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, OutputMergerLogicOp);
-FEATURE_SUPPORT_GET(D3D12_SHADER_MIN_PRECISION_SUPPORT, m_dOptions, MinPrecisionSupport);
-FEATURE_SUPPORT_GET(D3D12_TILED_RESOURCES_TIER, m_dOptions, TiledResourcesTier);
-FEATURE_SUPPORT_GET(D3D12_RESOURCE_BINDING_TIER, m_dOptions, ResourceBindingTier);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, PSSpecifiedStencilRefSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, TypedUAVLoadAdditionalFormats);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, ROVsSupported);
-FEATURE_SUPPORT_GET(D3D12_CONSERVATIVE_RASTERIZATION_TIER, m_dOptions, ConservativeRasterizationTier);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, StandardSwizzle64KBSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, CrossAdapterRowMajorTextureSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions, VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation);
-FEATURE_SUPPORT_GET(D3D12_RESOURCE_HEAP_TIER, m_dOptions, ResourceHeapTier);
-
-// Special procedure for handling caps that is also part of other features
-inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier() const noexcept
-{
- if (m_dCrossNode.SharingTier > D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED)
- {
- return m_dCrossNode.SharingTier;
- }
- else
- {
- return m_dOptions.CrossNodeSharingTier;
- }
-}
-
-inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const noexcept
-{
- if (m_dOptions.MaxGPUVirtualAddressBitsPerResource > 0)
- {
- return m_dOptions.MaxGPUVirtualAddressBitsPerResource;
- }
- else
- {
- return m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource;
- }
-}
-
-// 1: Architecture
-// Combined with Architecture1
-
-// 2: Feature Levels
-// Simply returns the highest supported feature level
-inline D3D_FEATURE_LEVEL CD3DX12FeatureSupport::MaxSupportedFeatureLevel() const noexcept
-{
- return m_eMaxFeatureLevel;
-}
-
-// 3: Feature Format Support
-inline HRESULT CD3DX12FeatureSupport::FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const
-{
- D3D12_FEATURE_DATA_FORMAT_SUPPORT dFormatSupport;
- dFormatSupport.Format = Format;
-
- // It is possible that the function call returns an error
- HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dFormatSupport, sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT));
-
- Support1 = dFormatSupport.Support1;
- Support2 = dFormatSupport.Support2; // Two outputs. Probably better just to take in the struct as an argument?
-
- return result;
-}
-
-// 4: Multisample Quality Levels
-inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const
-{
- D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS dMultisampleQualityLevels;
- dMultisampleQualityLevels.Format = Format;
- dMultisampleQualityLevels.SampleCount = SampleCount;
- dMultisampleQualityLevels.Flags = Flags;
-
- HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &dMultisampleQualityLevels, sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS));
-
- if (SUCCEEDED(result))
- {
- NumQualityLevels = dMultisampleQualityLevels.NumQualityLevels;
- }
- else
- {
- NumQualityLevels = 0;
- }
-
- return result;
-}
-
-// 5: Format Info
-inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const
-{
- D3D12_FEATURE_DATA_FORMAT_INFO dFormatInfo;
- dFormatInfo.Format = Format;
-
- HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &dFormatInfo, sizeof(D3D12_FEATURE_DATA_FORMAT_INFO));
- if (FAILED(result))
- {
- PlaneCount = 0;
- }
- else
- {
- PlaneCount = dFormatInfo.PlaneCount;
- }
- return result;
-}
-
-// 6: GPU Virtual Address Support
-// MaxGPUVirtualAddressBitsPerResource handled in D3D12Options
-FEATURE_SUPPORT_GET(UINT, m_dGPUVASupport, MaxGPUVirtualAddressBitsPerProcess);
-
-// 7: Shader Model
-inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const noexcept
-{
- return m_dShaderModel.HighestShaderModel;
-}
-
-// 8: D3D12 Options1
-FEATURE_SUPPORT_GET(BOOL, m_dOptions1, WaveOps);
-FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMin);
-FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMax);
-FEATURE_SUPPORT_GET(UINT, m_dOptions1, TotalLaneCount);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions1, ExpandedComputeResourceStates);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions1, Int64ShaderOps);
-
-// 10: Protected Resource Session Support
-inline D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS CD3DX12FeatureSupport::ProtectedResourceSessionSupport(UINT NodeIndex) const
-{
- return m_dProtectedResourceSessionSupport[NodeIndex].Support;
-}
-
-// 12: Root Signature
-inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const noexcept
-{
- return m_dRootSignature.HighestVersion;
-}
-
-// 16: Architecture1
-// Same data fields can be queried from m_dArchitecture
-FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, TileBasedRenderer);
-FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, UMA);
-FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, CacheCoherentUMA);
-FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, IsolatedMMU);
-
-// 18: D3D12 Options2
-FEATURE_SUPPORT_GET(BOOL, m_dOptions2, DepthBoundsTestSupported);
-FEATURE_SUPPORT_GET(D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER, m_dOptions2, ProgrammableSamplePositionsTier);
-
-// 19: Shader Cache
-FEATURE_SUPPORT_GET_NAME(D3D12_SHADER_CACHE_SUPPORT_FLAGS, m_dShaderCache, SupportFlags, ShaderCacheSupportFlags);
-
-// 20: Command Queue Priority
-inline BOOL CD3DX12FeatureSupport::CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority)
-{
- m_dCommandQueuePriority.CommandListType = CommandListType;
- m_dCommandQueuePriority.Priority = Priority;
-
- if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &m_dCommandQueuePriority, sizeof(D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY))))
- {
- return false;
- }
-
- return m_dCommandQueuePriority.PriorityForTypeIsSupported;
-}
-
-// 21: D3D12 Options3
-FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CopyQueueTimestampQueriesSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CastingFullyTypedFormatSupported);
-FEATURE_SUPPORT_GET(D3D12_COMMAND_LIST_SUPPORT_FLAGS, m_dOptions3, WriteBufferImmediateSupportFlags);
-FEATURE_SUPPORT_GET(D3D12_VIEW_INSTANCING_TIER, m_dOptions3, ViewInstancingTier);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions3, BarycentricsSupported);
-
-// 22: Existing Heaps
-FEATURE_SUPPORT_GET_NAME(BOOL, m_dExistingHeaps, Supported, ExistingHeapsSupported);
-
-// 23: D3D12 Options4
-FEATURE_SUPPORT_GET(BOOL, m_dOptions4, MSAA64KBAlignedTextureSupported);
-FEATURE_SUPPORT_GET(D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER, m_dOptions4, SharedResourceCompatibilityTier);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions4, Native16BitShaderOpsSupported);
-
-// 24: Serialization
-FEATURE_SUPPORT_GET_NODE_INDEXED(D3D12_HEAP_SERIALIZATION_TIER, m_dSerialization, HeapSerializationTier);
-
-// 25: Cross Node
-// CrossNodeSharingTier handled in D3D12Options
-FEATURE_SUPPORT_GET_NAME(BOOL, m_dCrossNode, AtomicShaderInstructions, CrossNodeAtomicShaderInstructions);
-
-// 27: D3D12 Options5
-FEATURE_SUPPORT_GET(BOOL, m_dOptions5, SRVOnlyTiledResourceTier3);
-FEATURE_SUPPORT_GET(D3D12_RENDER_PASS_TIER, m_dOptions5, RenderPassesTier);
-FEATURE_SUPPORT_GET(D3D12_RAYTRACING_TIER, m_dOptions5, RaytracingTier);
-
-// 28: Displayable
-FEATURE_SUPPORT_GET(BOOL, m_dDisplayable, DisplayableTexture);
-// SharedResourceCompatibilityTier handled in D3D12Options4
-
-// 30: D3D12 Options6
-FEATURE_SUPPORT_GET(BOOL, m_dOptions6, AdditionalShadingRatesSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions6, PerPrimitiveShadingRateSupportedWithViewportIndexing);
-FEATURE_SUPPORT_GET(D3D12_VARIABLE_SHADING_RATE_TIER, m_dOptions6, VariableShadingRateTier);
-FEATURE_SUPPORT_GET(UINT, m_dOptions6, ShadingRateImageTileSize);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions6, BackgroundProcessingSupported);
-
-// 31: Query Meta Command
-// Keep the original call routine
-inline HRESULT CD3DX12FeatureSupport::QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const
-{
- return m_pDevice->CheckFeatureSupport(D3D12_FEATURE_QUERY_META_COMMAND, &dQueryMetaCommand, sizeof(D3D12_FEATURE_DATA_QUERY_META_COMMAND));
-}
-
-// 32: D3D12 Options7
-FEATURE_SUPPORT_GET(D3D12_MESH_SHADER_TIER, m_dOptions7, MeshShaderTier);
-FEATURE_SUPPORT_GET(D3D12_SAMPLER_FEEDBACK_TIER, m_dOptions7, SamplerFeedbackTier);
-
-// 33: Protected Resource Session Type Count
-FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(UINT, m_dProtectedResourceSessionTypeCount, Count, ProtectedResourceSessionTypeCount);
-
-// 34: Protected Resource Session Types
-FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(std::vector<GUID>, m_dProtectedResourceSessionTypes, TypeVec, ProtectedResourceSessionTypes);
-
-// 36: Options8
-FEATURE_SUPPORT_GET(BOOL, m_dOptions8, UnalignedBlockTexturesSupported);
-
-// 37: Options9
-FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderPipelineStatsSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderSupportsFullRangeRenderTargetArrayIndex);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnTypedResourceSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnGroupSharedSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions9, DerivativesInMeshAndAmplificationShadersSupported);
-FEATURE_SUPPORT_GET(D3D12_WAVE_MMA_TIER, m_dOptions9, WaveMMATier);
-
-// 39: Options10
-FEATURE_SUPPORT_GET(BOOL, m_dOptions10, VariableRateShadingSumCombinerSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions10, MeshShaderPerPrimitiveShadingRateSupported);
-
-// 40: Options11
-FEATURE_SUPPORT_GET(BOOL, m_dOptions11, AtomicInt64OnDescriptorHeapResourceSupported);
-
-// 41: Options12
-FEATURE_SUPPORT_GET(D3D12_TRI_STATE, m_dOptions12, MSPrimitivesPipelineStatisticIncludesCulledPrimitives);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions12, EnhancedBarriersSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions12, RelaxedFormatCastingSupported);
-
-// 42: Options13
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedBufferTextureCopyPitchSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedVertexElementAlignmentSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportHeightFlipsYSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportDepthFlipsZSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, TextureCopyBetweenDimensionsSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions13, AlphaBlendFactorSupported);
-
-// 43: Options14
-FEATURE_SUPPORT_GET(BOOL, m_dOptions14, AdvancedTextureOpsSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions14, WriteableMSAATexturesSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions14, IndependentFrontAndBackStencilRefMaskSupported);
-
-// 44: Options15
-FEATURE_SUPPORT_GET(BOOL, m_dOptions15, TriangleFanSupported);
-FEATURE_SUPPORT_GET(BOOL, m_dOptions15, DynamicIndexBufferStripCutSupported);
-
-// Helper function to decide the highest shader model supported by the system
-// Stores the result in m_dShaderModel
-// Must be updated whenever a new shader model is added to the d3d12.h header
-inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel()
-{
- // Check support in descending order
- HRESULT result;
-
- const D3D_SHADER_MODEL allModelVersions[] =
- {
- D3D_SHADER_MODEL_6_8,
- D3D_SHADER_MODEL_6_7,
- D3D_SHADER_MODEL_6_6,
- D3D_SHADER_MODEL_6_5,
- D3D_SHADER_MODEL_6_4,
- D3D_SHADER_MODEL_6_3,
- D3D_SHADER_MODEL_6_2,
- D3D_SHADER_MODEL_6_1,
- D3D_SHADER_MODEL_6_0,
- D3D_SHADER_MODEL_5_1
- };
- constexpr size_t numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL);
-
- for (size_t i = 0; i < numModelVersions; i++)
- {
- m_dShaderModel.HighestShaderModel = allModelVersions[i];
- result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &m_dShaderModel, sizeof(D3D12_FEATURE_DATA_SHADER_MODEL));
- if (result != E_INVALIDARG)
- {
- // Indicates that the version is recognizable by the runtime and stored in the struct
- // Also terminate on unexpected error code
- if (FAILED(result))
- {
- m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
- }
- return result;
- }
- }
-
- // Shader model may not be supported. Continue the rest initializations
- m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
- return S_OK;
-}
-
-// Helper function to decide the highest root signature supported
-// Must be updated whenever a new root signature version is added to the d3d12.h header
-inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion()
-{
- HRESULT result;
-
- const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] =
- {
- D3D_ROOT_SIGNATURE_VERSION_1_1,
- D3D_ROOT_SIGNATURE_VERSION_1_0,
- D3D_ROOT_SIGNATURE_VERSION_1,
- };
- constexpr size_t numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION);
-
- for (size_t i = 0; i < numRootSignatureVersions; i++)
- {
- m_dRootSignature.HighestVersion = allRootSignatureVersions[i];
- result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE, &m_dRootSignature, sizeof(D3D12_FEATURE_DATA_ROOT_SIGNATURE));
- if (result != E_INVALIDARG)
- {
- if (FAILED(result))
- {
- m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
- }
- // If succeeded, the highest version is already written into the member struct
- return result;
- }
- }
-
- // No version left. Set to invalid value and continue.
- m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
- return S_OK;
-}
-
-// Helper funcion to decide the highest feature level
-inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel()
-{
- HRESULT result;
-
- // Check against a list of all feature levels present in d3dcommon.h
- // Needs to be updated for future feature levels
- const D3D_FEATURE_LEVEL allLevels[] =
- {
- D3D_FEATURE_LEVEL_12_2,
- D3D_FEATURE_LEVEL_12_1,
- D3D_FEATURE_LEVEL_12_0,
- D3D_FEATURE_LEVEL_11_1,
- D3D_FEATURE_LEVEL_11_0,
- D3D_FEATURE_LEVEL_10_1,
- D3D_FEATURE_LEVEL_10_0,
- D3D_FEATURE_LEVEL_9_3,
- D3D_FEATURE_LEVEL_9_2,
- D3D_FEATURE_LEVEL_9_1,
- D3D_FEATURE_LEVEL_1_0_CORE
- };
-
- D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel;
- dFeatureLevel.NumFeatureLevels = static_cast<UINT>(sizeof(allLevels) / sizeof(D3D_FEATURE_LEVEL));
- dFeatureLevel.pFeatureLevelsRequested = allLevels;
-
- result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, &dFeatureLevel, sizeof(D3D12_FEATURE_DATA_FEATURE_LEVELS));
- if (SUCCEEDED(result))
- {
- m_eMaxFeatureLevel = dFeatureLevel.MaxSupportedFeatureLevel;
- }
- else
- {
- m_eMaxFeatureLevel = static_cast<D3D_FEATURE_LEVEL>(0);
-
- if (result == DXGI_ERROR_UNSUPPORTED)
- {
- // Indicates that none supported. Continue initialization
- result = S_OK;
- }
- }
- return result;
-}
-
-// Helper function to initialize local protected resource session types structs
-inline HRESULT CD3DX12FeatureSupport::QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count)
-{
- auto& CurrentPRSTypes = m_dProtectedResourceSessionTypes[NodeIndex];
- CurrentPRSTypes.NodeIndex = NodeIndex;
- CurrentPRSTypes.Count = Count;
- CurrentPRSTypes.TypeVec.resize(CurrentPRSTypes.Count);
- CurrentPRSTypes.pTypes = CurrentPRSTypes.TypeVec.data();
-
- HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES, &m_dProtectedResourceSessionTypes[NodeIndex], sizeof(D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES));
- if (FAILED(result))
- {
- // Resize TypeVec to empty
- CurrentPRSTypes.TypeVec.clear();
- }
-
- return result;
-}
-
-#undef FEATURE_SUPPORT_GET
-#undef FEATURE_SUPPORT_GET_NAME
-#undef FEATURE_SUPPORT_GET_NODE_INDEXED
-#undef FEATURE_SUPPORT_GET_NODE_INDEXED_NAME
-
-// end CD3DX12FeatureSupport
-
-#endif // !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
-
-#undef D3DX12_COM_PTR
-#undef D3DX12_COM_PTR_GET
-#undef D3DX12_COM_PTR_ADDRESSOF
-
-#endif // defined( __cplusplus )
-
-#endif //__D3DX12_H__
-
diff --git a/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp b/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp
new file mode 100644
index 0000000000..4d04c3a7a5
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp
@@ -0,0 +1,2627 @@
+#pragma once
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+//
+// High Level Goals
+//
+// - Serve as the runtime/DDI representation for all D3D11 tokenized code,
+// for all classes of programs, including pixel program, vertex program,
+// geometry program, etc.
+//
+// - Any information that HLSL needs to give to drivers is encoded in
+// this token format in some form.
+//
+// - Enable common tools and source code for managing all tokenizable
+// program formats.
+//
+// - Support extensible token definitions, allowing full customizations for
+// specific program classes, while maintaining general conventions for all
+// program models.
+//
+// - Binary backwards compatible with D3D10. Any token name that was originally
+// defined with "D3D10" in it is unchanged; D3D11 only adds new tokens.
+//
+// ----------------------------------------------------------------------------
+//
+// Low Level Feature Summary
+//
+// - DWORD based tokens always, for simplicity
+// - Opcode token is generally a single DWORD, though there is a bit indicating
+// if extended information (extra DWORD(s)) are present
+// - Operand tokens are a completely self contained, extensible format,
+// with scalar and 4-vector data types as first class citizens, but
+// allowance for extension to n-component vectors.
+// - Initial operand token identifies register type, register file
+// structure/dimensionality and mode of indexing for each dimension,
+// and choice of component selection mechanism (i.e. mask vs. swizzle etc).
+// - Optional additional extended operand tokens can defined things like
+// modifiers (which are not needed by default).
+// - Operand's immediate index value(s), if needed, appear as subsequent DWORD
+// values, and if relative addressing is specified, an additional completely
+// self contained operand definition appears nested in the token sequence.
+//
+// ----------------------------------------------------------------------------
+
+#include <winapifamily.h>
+
+#pragma region Application Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
+
+// ----------------------------------------------------------------------------
+// Version Token (VerTok)
+//
+// [07:00] minor version number (0-255)
+// [15:08] major version number (0-255)
+// [31:16] D3D10_SB_TOKENIZED_PROGRAM_TYPE
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_TOKENIZED_PROGRAM_TYPE
+{
+ D3D10_SB_PIXEL_SHADER = 0,
+ D3D10_SB_VERTEX_SHADER = 1,
+ D3D10_SB_GEOMETRY_SHADER = 2,
+
+ // D3D11 Shaders
+ D3D11_SB_HULL_SHADER = 3,
+ D3D11_SB_DOMAIN_SHADER = 4,
+ D3D11_SB_COMPUTE_SHADER = 5,
+
+ // Subset of D3D12 Shaders where this field is referenced by runtime
+ // Entries from 6-12 are unique to state objects
+ // (e.g. library, callable and raytracing shaders)
+ D3D12_SB_MESH_SHADER = 13,
+ D3D12_SB_AMPLIFICATION_SHADER = 14,
+
+ D3D11_SB_RESERVED0 = 0xFFF0
+} D3D10_SB_TOKENIZED_PROGRAM_TYPE;
+
+#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK 0xffff0000
+#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT 16
+
+// DECODER MACRO: Retrieve program type from version token
+#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE(VerTok) ((D3D10_SB_TOKENIZED_PROGRAM_TYPE)(((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT))
+
+#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK 0x000000f0
+#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT 4
+#define D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK 0x0000000f
+
+// DECODER MACRO: Retrieve major version # from version token
+#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION(VerTok) (((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT)
+// DECODER MACRO: Retrieve minor version # from version token
+#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION(VerTok) ((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK)
+
+// ENCODER MACRO: Create complete VerTok
+#define ENCODE_D3D10_SB_TOKENIZED_PROGRAM_VERSION_TOKEN(ProgType,MajorVer,MinorVer) ((((ProgType)<<D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT)&D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK)|\
+ ((((MajorVer)<<D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT)&D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK))|\
+ ((MinorVer)&D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK))
+
+// ----------------------------------------------------------------------------
+// Length Token (LenTok)
+//
+// Always follows VerTok
+//
+// [31:00] Unsigned integer count of number of
+// DWORDs in program code, including version
+// and length tokens. So the minimum value
+// is 0x00000002 (if an empty program is ever
+// valid).
+//
+// ----------------------------------------------------------------------------
+
+// DECODER MACRO: Retrieve program length
+#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_LENGTH(LenTok) (LenTok)
+// ENCODER MACRO: Create complete LenTok
+#define ENCODE_D3D10_SB_TOKENIZED_PROGRAM_LENGTH(Length) (Length)
+#define MAX_D3D10_SB_TOKENIZED_PROGRAM_LENGTH (0xffffffff)
+
+// ----------------------------------------------------------------------------
+// Opcode Format (OpcodeToken0)
+//
+// [10:00] D3D10_SB_OPCODE_TYPE
+// if( [10:00] == D3D10_SB_OPCODE_CUSTOMDATA )
+// {
+// Token starts a custom-data block. See "Custom-Data Block Format".
+// }
+// else // standard opcode token
+// {
+// [23:11] Opcode-Specific Controls
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended opcode token.
+// }
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_OPCODE_TYPE {
+ D3D10_SB_OPCODE_ADD ,
+ D3D10_SB_OPCODE_AND ,
+ D3D10_SB_OPCODE_BREAK ,
+ D3D10_SB_OPCODE_BREAKC ,
+ D3D10_SB_OPCODE_CALL ,
+ D3D10_SB_OPCODE_CALLC ,
+ D3D10_SB_OPCODE_CASE ,
+ D3D10_SB_OPCODE_CONTINUE ,
+ D3D10_SB_OPCODE_CONTINUEC ,
+ D3D10_SB_OPCODE_CUT ,
+ D3D10_SB_OPCODE_DEFAULT ,
+ D3D10_SB_OPCODE_DERIV_RTX ,
+ D3D10_SB_OPCODE_DERIV_RTY ,
+ D3D10_SB_OPCODE_DISCARD ,
+ D3D10_SB_OPCODE_DIV ,
+ D3D10_SB_OPCODE_DP2 ,
+ D3D10_SB_OPCODE_DP3 ,
+ D3D10_SB_OPCODE_DP4 ,
+ D3D10_SB_OPCODE_ELSE ,
+ D3D10_SB_OPCODE_EMIT ,
+ D3D10_SB_OPCODE_EMITTHENCUT ,
+ D3D10_SB_OPCODE_ENDIF ,
+ D3D10_SB_OPCODE_ENDLOOP ,
+ D3D10_SB_OPCODE_ENDSWITCH ,
+ D3D10_SB_OPCODE_EQ ,
+ D3D10_SB_OPCODE_EXP ,
+ D3D10_SB_OPCODE_FRC ,
+ D3D10_SB_OPCODE_FTOI ,
+ D3D10_SB_OPCODE_FTOU ,
+ D3D10_SB_OPCODE_GE ,
+ D3D10_SB_OPCODE_IADD ,
+ D3D10_SB_OPCODE_IF ,
+ D3D10_SB_OPCODE_IEQ ,
+ D3D10_SB_OPCODE_IGE ,
+ D3D10_SB_OPCODE_ILT ,
+ D3D10_SB_OPCODE_IMAD ,
+ D3D10_SB_OPCODE_IMAX ,
+ D3D10_SB_OPCODE_IMIN ,
+ D3D10_SB_OPCODE_IMUL ,
+ D3D10_SB_OPCODE_INE ,
+ D3D10_SB_OPCODE_INEG ,
+ D3D10_SB_OPCODE_ISHL ,
+ D3D10_SB_OPCODE_ISHR ,
+ D3D10_SB_OPCODE_ITOF ,
+ D3D10_SB_OPCODE_LABEL ,
+ D3D10_SB_OPCODE_LD ,
+ D3D10_SB_OPCODE_LD_MS ,
+ D3D10_SB_OPCODE_LOG ,
+ D3D10_SB_OPCODE_LOOP ,
+ D3D10_SB_OPCODE_LT ,
+ D3D10_SB_OPCODE_MAD ,
+ D3D10_SB_OPCODE_MIN ,
+ D3D10_SB_OPCODE_MAX ,
+ D3D10_SB_OPCODE_CUSTOMDATA ,
+ D3D10_SB_OPCODE_MOV ,
+ D3D10_SB_OPCODE_MOVC ,
+ D3D10_SB_OPCODE_MUL ,
+ D3D10_SB_OPCODE_NE ,
+ D3D10_SB_OPCODE_NOP ,
+ D3D10_SB_OPCODE_NOT ,
+ D3D10_SB_OPCODE_OR ,
+ D3D10_SB_OPCODE_RESINFO ,
+ D3D10_SB_OPCODE_RET ,
+ D3D10_SB_OPCODE_RETC ,
+ D3D10_SB_OPCODE_ROUND_NE ,
+ D3D10_SB_OPCODE_ROUND_NI ,
+ D3D10_SB_OPCODE_ROUND_PI ,
+ D3D10_SB_OPCODE_ROUND_Z ,
+ D3D10_SB_OPCODE_RSQ ,
+ D3D10_SB_OPCODE_SAMPLE ,
+ D3D10_SB_OPCODE_SAMPLE_C ,
+ D3D10_SB_OPCODE_SAMPLE_C_LZ ,
+ D3D10_SB_OPCODE_SAMPLE_L ,
+ D3D10_SB_OPCODE_SAMPLE_D ,
+ D3D10_SB_OPCODE_SAMPLE_B ,
+ D3D10_SB_OPCODE_SQRT ,
+ D3D10_SB_OPCODE_SWITCH ,
+ D3D10_SB_OPCODE_SINCOS ,
+ D3D10_SB_OPCODE_UDIV ,
+ D3D10_SB_OPCODE_ULT ,
+ D3D10_SB_OPCODE_UGE ,
+ D3D10_SB_OPCODE_UMUL ,
+ D3D10_SB_OPCODE_UMAD ,
+ D3D10_SB_OPCODE_UMAX ,
+ D3D10_SB_OPCODE_UMIN ,
+ D3D10_SB_OPCODE_USHR ,
+ D3D10_SB_OPCODE_UTOF ,
+ D3D10_SB_OPCODE_XOR ,
+ D3D10_SB_OPCODE_DCL_RESOURCE , // DCL* opcodes have
+ D3D10_SB_OPCODE_DCL_CONSTANT_BUFFER , // custom operand formats.
+ D3D10_SB_OPCODE_DCL_SAMPLER ,
+ D3D10_SB_OPCODE_DCL_INDEX_RANGE ,
+ D3D10_SB_OPCODE_DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY ,
+ D3D10_SB_OPCODE_DCL_GS_INPUT_PRIMITIVE ,
+ D3D10_SB_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT ,
+ D3D10_SB_OPCODE_DCL_INPUT ,
+ D3D10_SB_OPCODE_DCL_INPUT_SGV ,
+ D3D10_SB_OPCODE_DCL_INPUT_SIV ,
+ D3D10_SB_OPCODE_DCL_INPUT_PS ,
+ D3D10_SB_OPCODE_DCL_INPUT_PS_SGV ,
+ D3D10_SB_OPCODE_DCL_INPUT_PS_SIV ,
+ D3D10_SB_OPCODE_DCL_OUTPUT ,
+ D3D10_SB_OPCODE_DCL_OUTPUT_SGV ,
+ D3D10_SB_OPCODE_DCL_OUTPUT_SIV ,
+ D3D10_SB_OPCODE_DCL_TEMPS ,
+ D3D10_SB_OPCODE_DCL_INDEXABLE_TEMP ,
+ D3D10_SB_OPCODE_DCL_GLOBAL_FLAGS ,
+
+// -----------------------------------------------
+
+ // This marks the end of D3D10.0 opcodes
+ D3D10_SB_OPCODE_RESERVED0,
+
+// ---------- DX 10.1 op codes---------------------
+
+ D3D10_1_SB_OPCODE_LOD,
+ D3D10_1_SB_OPCODE_GATHER4,
+ D3D10_1_SB_OPCODE_SAMPLE_POS,
+ D3D10_1_SB_OPCODE_SAMPLE_INFO,
+
+// -----------------------------------------------
+
+ // This marks the end of D3D10.1 opcodes
+ D3D10_1_SB_OPCODE_RESERVED1,
+
+// ---------- DX 11 op codes---------------------
+ D3D11_SB_OPCODE_HS_DECLS , // token marks beginning of HS sub-shader
+ D3D11_SB_OPCODE_HS_CONTROL_POINT_PHASE , // token marks beginning of HS sub-shader
+ D3D11_SB_OPCODE_HS_FORK_PHASE , // token marks beginning of HS sub-shader
+ D3D11_SB_OPCODE_HS_JOIN_PHASE , // token marks beginning of HS sub-shader
+
+ D3D11_SB_OPCODE_EMIT_STREAM ,
+ D3D11_SB_OPCODE_CUT_STREAM ,
+ D3D11_SB_OPCODE_EMITTHENCUT_STREAM ,
+ D3D11_SB_OPCODE_INTERFACE_CALL ,
+
+ D3D11_SB_OPCODE_BUFINFO ,
+ D3D11_SB_OPCODE_DERIV_RTX_COARSE ,
+ D3D11_SB_OPCODE_DERIV_RTX_FINE ,
+ D3D11_SB_OPCODE_DERIV_RTY_COARSE ,
+ D3D11_SB_OPCODE_DERIV_RTY_FINE ,
+ D3D11_SB_OPCODE_GATHER4_C ,
+ D3D11_SB_OPCODE_GATHER4_PO ,
+ D3D11_SB_OPCODE_GATHER4_PO_C ,
+ D3D11_SB_OPCODE_RCP ,
+ D3D11_SB_OPCODE_F32TOF16 ,
+ D3D11_SB_OPCODE_F16TOF32 ,
+ D3D11_SB_OPCODE_UADDC ,
+ D3D11_SB_OPCODE_USUBB ,
+ D3D11_SB_OPCODE_COUNTBITS ,
+ D3D11_SB_OPCODE_FIRSTBIT_HI ,
+ D3D11_SB_OPCODE_FIRSTBIT_LO ,
+ D3D11_SB_OPCODE_FIRSTBIT_SHI ,
+ D3D11_SB_OPCODE_UBFE ,
+ D3D11_SB_OPCODE_IBFE ,
+ D3D11_SB_OPCODE_BFI ,
+ D3D11_SB_OPCODE_BFREV ,
+ D3D11_SB_OPCODE_SWAPC ,
+
+ D3D11_SB_OPCODE_DCL_STREAM ,
+ D3D11_SB_OPCODE_DCL_FUNCTION_BODY ,
+ D3D11_SB_OPCODE_DCL_FUNCTION_TABLE ,
+ D3D11_SB_OPCODE_DCL_INTERFACE ,
+
+ D3D11_SB_OPCODE_DCL_INPUT_CONTROL_POINT_COUNT ,
+ D3D11_SB_OPCODE_DCL_OUTPUT_CONTROL_POINT_COUNT ,
+ D3D11_SB_OPCODE_DCL_TESS_DOMAIN ,
+ D3D11_SB_OPCODE_DCL_TESS_PARTITIONING ,
+ D3D11_SB_OPCODE_DCL_TESS_OUTPUT_PRIMITIVE ,
+ D3D11_SB_OPCODE_DCL_HS_MAX_TESSFACTOR ,
+ D3D11_SB_OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT ,
+ D3D11_SB_OPCODE_DCL_HS_JOIN_PHASE_INSTANCE_COUNT ,
+
+ D3D11_SB_OPCODE_DCL_THREAD_GROUP ,
+ D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_TYPED ,
+ D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW ,
+ D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED,
+ D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_RAW,
+ D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED,
+ D3D11_SB_OPCODE_DCL_RESOURCE_RAW ,
+ D3D11_SB_OPCODE_DCL_RESOURCE_STRUCTURED ,
+ D3D11_SB_OPCODE_LD_UAV_TYPED ,
+ D3D11_SB_OPCODE_STORE_UAV_TYPED ,
+ D3D11_SB_OPCODE_LD_RAW ,
+ D3D11_SB_OPCODE_STORE_RAW ,
+ D3D11_SB_OPCODE_LD_STRUCTURED ,
+ D3D11_SB_OPCODE_STORE_STRUCTURED ,
+ D3D11_SB_OPCODE_ATOMIC_AND ,
+ D3D11_SB_OPCODE_ATOMIC_OR ,
+ D3D11_SB_OPCODE_ATOMIC_XOR ,
+ D3D11_SB_OPCODE_ATOMIC_CMP_STORE ,
+ D3D11_SB_OPCODE_ATOMIC_IADD ,
+ D3D11_SB_OPCODE_ATOMIC_IMAX ,
+ D3D11_SB_OPCODE_ATOMIC_IMIN ,
+ D3D11_SB_OPCODE_ATOMIC_UMAX ,
+ D3D11_SB_OPCODE_ATOMIC_UMIN ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_ALLOC ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_CONSUME ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_IADD ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_AND ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_OR ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_XOR ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_EXCH ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_CMP_EXCH ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_IMAX ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_IMIN ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_UMAX ,
+ D3D11_SB_OPCODE_IMM_ATOMIC_UMIN ,
+ D3D11_SB_OPCODE_SYNC ,
+
+ D3D11_SB_OPCODE_DADD ,
+ D3D11_SB_OPCODE_DMAX ,
+ D3D11_SB_OPCODE_DMIN ,
+ D3D11_SB_OPCODE_DMUL ,
+ D3D11_SB_OPCODE_DEQ ,
+ D3D11_SB_OPCODE_DGE ,
+ D3D11_SB_OPCODE_DLT ,
+ D3D11_SB_OPCODE_DNE ,
+ D3D11_SB_OPCODE_DMOV ,
+ D3D11_SB_OPCODE_DMOVC ,
+ D3D11_SB_OPCODE_DTOF ,
+ D3D11_SB_OPCODE_FTOD ,
+
+ D3D11_SB_OPCODE_EVAL_SNAPPED ,
+ D3D11_SB_OPCODE_EVAL_SAMPLE_INDEX ,
+ D3D11_SB_OPCODE_EVAL_CENTROID ,
+
+ D3D11_SB_OPCODE_DCL_GS_INSTANCE_COUNT ,
+
+ D3D11_SB_OPCODE_ABORT ,
+ D3D11_SB_OPCODE_DEBUG_BREAK ,
+
+// -----------------------------------------------
+
+ // This marks the end of D3D11.0 opcodes
+ D3D11_SB_OPCODE_RESERVED0,
+
+ D3D11_1_SB_OPCODE_DDIV,
+ D3D11_1_SB_OPCODE_DFMA,
+ D3D11_1_SB_OPCODE_DRCP,
+
+ D3D11_1_SB_OPCODE_MSAD,
+
+ D3D11_1_SB_OPCODE_DTOI,
+ D3D11_1_SB_OPCODE_DTOU,
+ D3D11_1_SB_OPCODE_ITOD,
+ D3D11_1_SB_OPCODE_UTOD,
+
+// -----------------------------------------------
+
+ // This marks the end of D3D11.1 opcodes
+ D3D11_1_SB_OPCODE_RESERVED0,
+
+ D3DWDDM1_3_SB_OPCODE_GATHER4_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_GATHER4_C_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_GATHER4_PO_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_GATHER4_PO_C_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_LD_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_LD_MS_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_LD_UAV_TYPED_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_LD_RAW_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_LD_STRUCTURED_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_L_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_C_LZ_FEEDBACK,
+
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_CLAMP_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_B_CLAMP_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_D_CLAMP_FEEDBACK,
+ D3DWDDM1_3_SB_OPCODE_SAMPLE_C_CLAMP_FEEDBACK,
+
+ D3DWDDM1_3_SB_OPCODE_CHECK_ACCESS_FULLY_MAPPED,
+
+// -----------------------------------------------
+
+ // This marks the end of WDDM 1.3 opcodes
+ D3DWDDM1_3_SB_OPCODE_RESERVED0,
+
+ D3D10_SB_NUM_OPCODES // Should be the last entry
+} D3D10_SB_OPCODE_TYPE;
+
+#define D3D10_SB_OPCODE_TYPE_MASK 0x00007ff
+// DECODER MACRO: Retrieve program opcode
+#define DECODE_D3D10_SB_OPCODE_TYPE(OpcodeToken0) ((D3D10_SB_OPCODE_TYPE)((OpcodeToken0)&D3D10_SB_OPCODE_TYPE_MASK))
+// ENCODER MACRO: Create the opcode-type portion of OpcodeToken0
+#define ENCODE_D3D10_SB_OPCODE_TYPE(OpcodeName) ((OpcodeName)&D3D10_SB_OPCODE_TYPE_MASK)
+
+#define D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK 0x7f000000
+#define D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT 24
+// DECODER MACRO: Retrieve instruction length
+// in # of DWORDs including the opcode token(s).
+// The range is 1-127.
+#define DECODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(OpcodeToken0) (((OpcodeToken0)&D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK)>> D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT)
+
+// ENCODER MACRO: Store instruction length
+// portion of OpcodeToken0, in # of DWORDs
+// including the opcode token(s).
+// Valid range is 1-127.
+#define ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(Length) (((Length)<<D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT)&D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_MASK)
+#define MAX_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH 127
+
+#define D3D10_SB_INSTRUCTION_SATURATE_MASK 0x00002000
+// DECODER MACRO: Check OpcodeToken0 to see if an instruction
+// is to saturate the result [0..1]
+// This flag is indicated by one of the bits in the
+// opcode specific control range.
+#define DECODE_IS_D3D10_SB_INSTRUCTION_SATURATE_ENABLED(OpcodeToken0) ((OpcodeToken0)&D3D10_SB_INSTRUCTION_SATURATE_MASK)
+// ENCODER MACRO: Encode in OpcodeToken0 if instruction is to saturate the result.
+#define ENCODE_D3D10_SB_INSTRUCTION_SATURATE(bSat) (((bSat)!=0)?D3D10_SB_INSTRUCTION_SATURATE_MASK:0)
+
+// Boolean test for conditional instructions such as if (if_z or if_nz)
+// This is part of the opcode specific control range.
+typedef enum D3D10_SB_INSTRUCTION_TEST_BOOLEAN
+{
+ D3D10_SB_INSTRUCTION_TEST_ZERO = 0,
+ D3D10_SB_INSTRUCTION_TEST_NONZERO = 1
+} D3D10_SB_INSTRUCTION_TEST_BOOLEAN;
+#define D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK 0x00040000
+#define D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT 18
+
+// DECODER MACRO: For an OpcodeToken0 for requires either a
+// zero or non-zero test, determine which test was chosen.
+#define DECODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN(OpcodeToken0) ((D3D10_SB_INSTRUCTION_TEST_BOOLEAN)(((OpcodeToken0)&D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK)>>D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT))
+// ENCODER MACRO: Store "zero" or "nonzero" in the opcode
+// specific control range of OpcodeToken0
+#define ENCODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN(Boolean) (((Boolean)<<D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT)&D3D10_SB_INSTRUCTION_TEST_BOOLEAN_MASK)
+
+// Precise value mask (bits 19-22)
+// This is part of the opcode specific control range.
+// It's 1 bit per-channel of the output, for instructions with multiple
+// output operands, it applies to that component in each operand. This
+// uses the components defined in D3D10_SB_COMPONENT_NAME.
+#define D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK 0x00780000
+#define D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT 19
+
+// DECODER MACRO: this macro extracts from OpcodeToken0 the 4 component
+// (xyzw) mask, as a field of D3D10_SB_4_COMPONENT_[X|Y|Z|W] flags.
+#define DECODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(OpcodeToken0) ((((OpcodeToken0)&D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK)>>D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT))
+// ENCODER MACRO: Given a set of
+// D3D10_SB_OPERAND_4_COMPONENT_[X|Y|Z|W] values
+// or'd together, encode them in OpcodeToken0.
+#define ENCODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(ComponentMask) (((ComponentMask)<<D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT)&D3D11_SB_INSTRUCTION_PRECISE_VALUES_MASK)
+
+// resinfo instruction return type
+typedef enum D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE
+{
+ D3D10_SB_RESINFO_INSTRUCTION_RETURN_FLOAT = 0,
+ D3D10_SB_RESINFO_INSTRUCTION_RETURN_RCPFLOAT = 1,
+ D3D10_SB_RESINFO_INSTRUCTION_RETURN_UINT = 2
+} D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE;
+
+#define D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK 0x00001800
+#define D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT 11
+
+// DECODER MACRO: For an OpcodeToken0 for the resinfo instruction,
+// determine the return type.
+#define DECODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE(OpcodeToken0) ((D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE)(((OpcodeToken0)&D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK)>>D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT))
+// ENCODER MACRO: Encode the return type for the resinfo instruction
+// in the opcode specific control range of OpcodeToken0
+#define ENCODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<<D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT)&D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_MASK)
+
+// sync instruction flags
+#define D3D11_SB_SYNC_THREADS_IN_GROUP 0x00000800
+#define D3D11_SB_SYNC_THREAD_GROUP_SHARED_MEMORY 0x00001000
+#define D3D11_SB_SYNC_UNORDERED_ACCESS_VIEW_MEMORY_GROUP 0x00002000
+#define D3D11_SB_SYNC_UNORDERED_ACCESS_VIEW_MEMORY_GLOBAL 0x00004000
+#define D3D11_SB_SYNC_FLAGS_MASK 0x00007800
+
+// DECODER MACRO: Retrieve flags for sync instruction from OpcodeToken0.
+#define DECODE_D3D11_SB_SYNC_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_SYNC_FLAGS_MASK)
+
+// ENCODER MACRO: Given a set of sync instruciton flags, encode them in OpcodeToken0.
+#define ENCODE_D3D11_SB_SYNC_FLAGS(Flags) ((Flags)&D3D11_SB_SYNC_FLAGS_MASK)
+
+#define D3D10_SB_OPCODE_EXTENDED_MASK 0x80000000
+#define D3D10_SB_OPCODE_EXTENDED_SHIFT 31
+// DECODER MACRO: Determine if the opcode is extended
+// by an additional opcode token. Currently there are no
+// extended opcodes.
+#define DECODE_IS_D3D10_SB_OPCODE_EXTENDED(OpcodeToken0) (((OpcodeToken0)&D3D10_SB_OPCODE_EXTENDED_MASK)>> D3D10_SB_OPCODE_EXTENDED_SHIFT)
+// ENCODER MACRO: Store in OpcodeToken0 whether the opcode is extended
+// by an additional opcode token.
+#define ENCODE_D3D10_SB_OPCODE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPCODE_EXTENDED_MASK:0)
+
+// ----------------------------------------------------------------------------
+// Extended Opcode Format (OpcodeToken1)
+//
+// If bit31 of an opcode token is set, the
+// opcode has an additional extended opcode token DWORD
+// directly following OpcodeToken0. Other tokens
+// expected for the opcode, such as the operand
+// token(s) always follow
+// OpcodeToken0 AND OpcodeToken1..n (extended
+// opcode tokens, if present).
+//
+// [05:00] D3D10_SB_EXTENDED_OPCODE_TYPE
+// [30:06] if([05:00] == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS)
+// {
+// This custom opcode contains controls for SAMPLE.
+// [08:06] Ignored, 0.
+// [12:09] U texel immediate offset (4 bit 2's comp) (0 default)
+// [16:13] V texel immediate offset (4 bit 2's comp) (0 default)
+// [20:17] W texel immediate offset (4 bit 2's comp) (0 default)
+// [30:14] Ignored, 0.
+// }
+// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM )
+// {
+// [10:06] D3D10_SB_RESOURCE_DIMENSION
+// [22:11] When dimension is D3D11_SB_RESOURCE_DIMENSION_STRUCTURED_BUFFER this holds the buffer stride, otherwise 0
+// [30:23] Ignored, 0.
+// }
+// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE )
+// {
+// [09:06] D3D10_SB_RESOURCE_RETURN_TYPE for component X
+// [13:10] D3D10_SB_RESOURCE_RETURN_TYPE for component Y
+// [17:14] D3D10_SB_RESOURCE_RETURN_TYPE for component Z
+// [21:18] D3D10_SB_RESOURCE_RETURN_TYPE for component W
+// [30:22] Ignored, 0.
+// }
+// else
+// {
+// [30:04] Ignored, 0.
+// }
+// [31] 0 normally. 1 there is another extended opcode. Any number
+// of extended opcode tokens can be chained. It is possible that some extended
+// opcode tokens could include multiple DWORDS - that is defined
+// on a case by case basis.
+//
+// ----------------------------------------------------------------------------
+typedef enum D3D10_SB_EXTENDED_OPCODE_TYPE
+{
+ D3D10_SB_EXTENDED_OPCODE_EMPTY = 0,
+ D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS = 1,
+ D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM = 2,
+ D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE = 3,
+} D3D10_SB_EXTENDED_OPCODE_TYPE;
+#define D3D11_SB_MAX_SIMULTANEOUS_EXTENDED_OPCODES 3
+
+#define D3D10_SB_EXTENDED_OPCODE_TYPE_MASK 0x0000003f
+
+// DECODER MACRO: Given an extended opcode
+// token (OpcodeToken1), figure out what type
+// of token it is (from D3D10_SB_EXTENDED_OPCODE_TYPE enum)
+// to be able to interpret the rest of the token's contents.
+#define DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(OpcodeToken1) ((D3D10_SB_EXTENDED_OPCODE_TYPE)((OpcodeToken1)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK))
+
+// ENCODER MACRO: Store extended opcode token
+// type in OpcodeToken1.
+#define ENCODE_D3D10_SB_EXTENDED_OPCODE_TYPE(ExtOpcodeType) ((ExtOpcodeType)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK)
+
+typedef enum D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD
+{
+ D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_U = 0,
+ D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_V = 1,
+ D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_W = 2,
+} D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD;
+#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK (3)
+#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord) (9+4*((Coord)&D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK))
+#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord) (0x0000000f<<D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord))
+
+// DECODER MACRO: Given an extended opcode token
+// (OpcodeToken1), and extended token type ==
+// D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS, determine the immediate
+// texel address offset for u/v/w (D3D10_SB_ADDRESS_OFFSET_COORD)
+// This macro returns a (signed) integer, by sign extending the
+// decoded 4 bit 2's complement immediate value.
+#define DECODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET(Coord,OpcodeToken1) ((((OpcodeToken1)&D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord))>>(D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord))))
+
+// ENCODER MACRO: Store the immediate texel address offset
+// for U or V or W Coord (D3D10_SB_ADDRESS_OFFSET_COORD) in an extended
+// opcode token (OpcodeToken1) that has extended opcode
+// type == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS (opcode type encoded separately)
+// A 2's complement number is expected as input, from which the LSB 4 bits are extracted.
+#define ENCODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET(Coord,ImmediateOffset) (((ImmediateOffset)<<D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord))&D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord))
+
+#define D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK 0x000007C0
+#define D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT 6
+
+// DECODER MACRO: Given an extended resource declaration token,
+// (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM), determine the resource dimension
+// (D3D10_SB_RESOURCE_DIMENSION enum)
+#define DECODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION(OpcodeTokenN) ((D3D10_SB_RESOURCE_DIMENSION)(((OpcodeTokenN)&D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK)>>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT))
+
+// ENCODER MACRO: Store resource dimension
+// (D3D10_SB_RESOURCE_DIMENSION enum) into a
+// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM)
+#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<<D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT)&D3D11_SB_EXTENDED_RESOURCE_DIMENSION_MASK)
+
+#define D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK 0x007FF800
+#define D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT 11
+
+// DECODER MACRO: Given an extended resource declaration token for a structured buffer,
+// (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM), determine the structure stride
+// (12-bit unsigned integer)
+#define DECODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(OpcodeTokenN) (((OpcodeTokenN)&D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK)>>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT)
+
+// ENCODER MACRO: Store resource dimension structure stride
+// (12-bit unsigned integer) into a
+// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM)
+#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(Stride) (((Stride)<<D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT)&D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_MASK)
+
+#define D3D10_SB_RESOURCE_RETURN_TYPE_MASK 0x0000000f
+#define D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS 0x00000004
+#define D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT 6
+
+// DECODER MACRO: Get the resource return type for component (0-3) from
+// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE)
+#define DECODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE(OpcodeTokenN, Component) \
+ ((D3D10_SB_RESOURCE_RETURN_TYPE)(((OpcodeTokenN) >> \
+ (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK))
+
+// ENCODER MACRO: Generate a resource return type for a component in an extended
+// resource delcaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE)
+#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE(ReturnType, Component) \
+ (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT))
+
+// ----------------------------------------------------------------------------
+// Custom-Data Block Format
+//
+// DWORD 0 (CustomDataDescTok):
+// [10:00] == D3D10_SB_OPCODE_CUSTOMDATA
+// [31:11] == D3D10_SB_CUSTOMDATA_CLASS
+//
+// DWORD 1:
+// 32-bit unsigned integer count of number
+// of DWORDs in custom-data block,
+// including DWORD 0 and DWORD 1.
+// So the minimum value is 0x00000002,
+// meaning empty custom-data.
+//
+// Layout of custom-data contents, for the various meta-data classes,
+// not defined in this file.
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_CUSTOMDATA_CLASS
+{
+ D3D10_SB_CUSTOMDATA_COMMENT = 0,
+ D3D10_SB_CUSTOMDATA_DEBUGINFO,
+ D3D10_SB_CUSTOMDATA_OPAQUE,
+ D3D10_SB_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER,
+ D3D11_SB_CUSTOMDATA_SHADER_MESSAGE,
+ D3D11_SB_CUSTOMDATA_SHADER_CLIP_PLANE_CONSTANT_MAPPINGS_FOR_DX9,
+} D3D10_SB_CUSTOMDATA_CLASS;
+
+#define D3D10_SB_CUSTOMDATA_CLASS_MASK 0xfffff800
+#define D3D10_SB_CUSTOMDATA_CLASS_SHIFT 11
+// DECODER MACRO: Find out what class of custom-data is present.
+// The contents of the custom-data block are defined
+// for each class of custom-data.
+#define DECODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataDescTok) ((D3D10_SB_CUSTOMDATA_CLASS)(((CustomDataDescTok)&D3D10_SB_CUSTOMDATA_CLASS_MASK)>>D3D10_SB_CUSTOMDATA_CLASS_SHIFT))
+// ENCODER MACRO: Create complete CustomDataDescTok
+#define ENCODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataClass) (ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_CUSTOMDATA)|(((CustomDataClass)<<D3D10_SB_CUSTOMDATA_CLASS_SHIFT)&D3D10_SB_CUSTOMDATA_CLASS_MASK))
+
+// ----------------------------------------------------------------------------
+// Instruction Operand Format (OperandToken0)
+//
+// [01:00] D3D10_SB_OPERAND_NUM_COMPONENTS
+// [11:02] Component Selection
+// if([01:00] == D3D10_SB_OPERAND_0_COMPONENT)
+// [11:02] = Ignored, 0
+// else if([01:00] == D3D10_SB_OPERAND_1_COMPONENT
+// [11:02] = Ignored, 0
+// else if([01:00] == D3D10_SB_OPERAND_4_COMPONENT
+// {
+// [03:02] = D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE
+// if([03:02] == D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE)
+// {
+// [07:04] = D3D10_SB_OPERAND_4_COMPONENT_MASK
+// [11:08] = Ignored, 0
+// }
+// else if([03:02] == D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE)
+// {
+// [11:04] = D3D10_SB_4_COMPONENT_SWIZZLE
+// }
+// else if([03:02] == D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE)
+// {
+// [05:04] = D3D10_SB_4_COMPONENT_NAME
+// [11:06] = Ignored, 0
+// }
+// }
+// else if([01:00] == D3D10_SB_OPERAND_N_COMPONENT)
+// {
+// Currently not defined.
+// }
+// [19:12] D3D10_SB_OPERAND_TYPE
+// [21:20] D3D10_SB_OPERAND_INDEX_DIMENSION:
+// Number of dimensions in the register
+// file (NOT the # of dimensions in the
+// individual register or memory
+// resource being referenced).
+// [24:22] if( [21:20] >= D3D10_SB_OPERAND_INDEX_1D )
+// D3D10_SB_OPERAND_INDEX_REPRESENTATION for first operand index
+// else
+// Ignored, 0
+// [27:25] if( [21:20] >= D3D10_SB_OPERAND_INDEX_2D )
+// D3D10_SB_OPERAND_INDEX_REPRESENTATION for second operand index
+// else
+// Ignored, 0
+// [30:28] if( [21:20] == D3D10_SB_OPERAND_INDEX_3D )
+// D3D10_SB_OPERAND_INDEX_REPRESENTATION for third operand index
+// else
+// Ignored, 0
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description.
+//
+// ----------------------------------------------------------------------------
+
+// Number of components in data vector referred to by operand.
+typedef enum D3D10_SB_OPERAND_NUM_COMPONENTS
+{
+ D3D10_SB_OPERAND_0_COMPONENT = 0,
+ D3D10_SB_OPERAND_1_COMPONENT = 1,
+ D3D10_SB_OPERAND_4_COMPONENT = 2,
+ D3D10_SB_OPERAND_N_COMPONENT = 3 // unused for now
+} D3D10_SB_OPERAND_NUM_COMPONENTS;
+#define D3D10_SB_OPERAND_NUM_COMPONENTS_MASK 0x00000003
+
+// DECODER MACRO: Extract from OperandToken0 how many components
+// the data vector referred to by the operand contains.
+// (D3D10_SB_OPERAND_NUM_COMPONENTS enum)
+#define DECODE_D3D10_SB_OPERAND_NUM_COMPONENTS(OperandToken0) ((D3D10_SB_OPERAND_NUM_COMPONENTS)((OperandToken0)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK))
+
+// ENCODER MACRO: Define in OperandToken0 how many components
+// the data vector referred to by the operand contains.
+// (D3D10_SB_OPERAND_NUM_COMPONENTS enum).
+#define ENCODE_D3D10_SB_OPERAND_NUM_COMPONENTS(NumComp) ((NumComp)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK)
+
+typedef enum D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE
+{
+ D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE = 0, // mask 4 components
+ D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1, // swizzle 4 components
+ D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE = 2, // select 1 of 4 components
+} D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE;
+
+#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK 0x0000000c
+#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT 2
+
+// DECODER MACRO: For an operand representing 4component data,
+// extract from OperandToken0 the method for selecting data from
+// the 4 components (D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE).
+#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(OperandToken0) ((D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE)(((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK)>>D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT))
+
+// ENCODER MACRO: For an operand representing 4component data,
+// encode in OperandToken0 a value from D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE
+#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(SelectionMode) (((SelectionMode)<<D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT)&D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK)
+
+typedef enum D3D10_SB_4_COMPONENT_NAME
+{
+ D3D10_SB_4_COMPONENT_X = 0,
+ D3D10_SB_4_COMPONENT_Y = 1,
+ D3D10_SB_4_COMPONENT_Z = 2,
+ D3D10_SB_4_COMPONENT_W = 3,
+ D3D10_SB_4_COMPONENT_R = 0,
+ D3D10_SB_4_COMPONENT_G = 1,
+ D3D10_SB_4_COMPONENT_B = 2,
+ D3D10_SB_4_COMPONENT_A = 3
+} D3D10_SB_4_COMPONENT_NAME;
+#define D3D10_SB_4_COMPONENT_NAME_MASK 3
+
+// MACROS FOR USE IN D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE:
+
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK 0x000000f0
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_SHIFT 4
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_X 0x00000010
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_Y 0x00000020
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_Z 0x00000040
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_W 0x00000080
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_R D3D10_SB_OPERAND_4_COMPONENT_MASK_X
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_G D3D10_SB_OPERAND_4_COMPONENT_MASK_Y
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_B D3D10_SB_OPERAND_4_COMPONENT_MASK_Z
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_A D3D10_SB_OPERAND_4_COMPONENT_MASK_W
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK_ALL D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK
+
+// DECODER MACRO: When 4 component selection mode is
+// D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE, this macro
+// extracts from OperandToken0 the 4 component (xyzw) mask,
+// as a field of D3D10_SB_OPERAND_4_COMPONENT_MASK_[X|Y|Z|W] flags.
+// Alternatively, the D3D10_SB_OPERAND_4_COMPONENT_MASK_[X|Y|Z|W] masks
+// can be tested on OperandToken0 directly, without this macro.
+#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_MASK(OperandToken0) ((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK)
+
+// ENCODER MACRO: Given a set of
+// D3D10_SB_OPERAND_4_COMPONENT_MASK_[X|Y|Z|W] values
+// or'd together, encode them in OperandToken0.
+#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_MASK(ComponentMask) ((ComponentMask)&D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK)
+
+// ENCODER/DECODER MACRO: Given a D3D10_SB_4_COMPONENT_NAME,
+// generate the 4-component mask for it.
+// This can be used in loops that build masks or read masks.
+// Alternatively, the D3D10_SB_OPERAND_4_COMPONENT_MASK_[X|Y|Z|W] masks
+// can be used directly, without this macro.
+#define D3D10_SB_OPERAND_4_COMPONENT_MASK(ComponentName) ((1<<(D3D10_SB_OPERAND_4_COMPONENT_MASK_SHIFT+ComponentName))&D3D10_SB_OPERAND_4_COMPONENT_MASK_MASK)
+
+// MACROS FOR USE IN D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE:
+
+#define D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MASK 0x00000ff0
+#define D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT 4
+
+// DECODER MACRO: When 4 component selection mode is
+// D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE, this macro
+// extracts from OperandToken0 the 4 component swizzle,
+// as a field of D3D10_SB_OPERAND_4_COMPONENT_MASK_[X|Y|Z|W] flags.
+#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(OperandToken0) ((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MASK)
+
+// DECODER MACRO: Pass a D3D10_SB_4_COMPONENT_NAME as "DestComp" in following
+// macro to extract, from OperandToken0 or from a decoded swizzle,
+// the swizzle source component (D3D10_SB_4_COMPONENT_NAME enum):
+#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SOURCE(OperandToken0,DestComp) ((D3D10_SB_4_COMPONENT_NAME)(((OperandToken0)>>(D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT+2*((DestComp)&D3D10_SB_4_COMPONENT_NAME_MASK)))&D3D10_SB_4_COMPONENT_NAME_MASK))
+
+// ENCODER MACRO: Generate a 4 component swizzle given
+// 4 D3D10_SB_4_COMPONENT_NAME source values for dest
+// components x, y, z, w respectively.
+#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(XSrc,YSrc,ZSrc,WSrc) ((((XSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)| \
+ (((YSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<2)| \
+ (((ZSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<4)| \
+ (((WSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<6) \
+ )<<D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT)
+
+// ENCODER/DECODER MACROS: Various common swizzle patterns
+// (noswizzle and replicate of each channels)
+#define D3D10_SB_OPERAND_4_COMPONENT_NOSWIZZLE ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(D3D10_SB_4_COMPONENT_X,\
+ D3D10_SB_4_COMPONENT_Y,\
+ D3D10_SB_4_COMPONENT_Z,\
+ D3D10_SB_4_COMPONENT_W)
+
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEX ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(D3D10_SB_4_COMPONENT_X,\
+ D3D10_SB_4_COMPONENT_X,\
+ D3D10_SB_4_COMPONENT_X,\
+ D3D10_SB_4_COMPONENT_X)
+
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEY ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(D3D10_SB_4_COMPONENT_Y,\
+ D3D10_SB_4_COMPONENT_Y,\
+ D3D10_SB_4_COMPONENT_Y,\
+ D3D10_SB_4_COMPONENT_Y)
+
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEZ ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(D3D10_SB_4_COMPONENT_Z,\
+ D3D10_SB_4_COMPONENT_Z,\
+ D3D10_SB_4_COMPONENT_Z,\
+ D3D10_SB_4_COMPONENT_Z)
+
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEW ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(D3D10_SB_4_COMPONENT_W,\
+ D3D10_SB_4_COMPONENT_W,\
+ D3D10_SB_4_COMPONENT_W,\
+ D3D10_SB_4_COMPONENT_W)
+
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATERED D3D10_SB_OPERAND_4_COMPONENT_REPLICATEX
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEGREEN D3D10_SB_OPERAND_4_COMPONENT_REPLICATEY
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEBLUE D3D10_SB_OPERAND_4_COMPONENT_REPLICATEZ
+#define D3D10_SB_OPERAND_4_COMPONENT_REPLICATEALPHA D3D10_SB_OPERAND_4_COMPONENT_REPLICATEW
+
+// MACROS FOR USE IN D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE:
+#define D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK 0x00000030
+#define D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT 4
+
+// DECODER MACRO: When 4 component selection mode is
+// D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE, this macro
+// extracts from OperandToken0 a D3D10_SB_4_COMPONENT_NAME
+// which picks one of the 4 components.
+#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1(OperandToken0) ((D3D10_SB_4_COMPONENT_NAME)(((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK)>>D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT))
+
+// ENCODER MACRO: Given a D3D10_SB_4_COMPONENT_NAME selecting
+// a single component for D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE,
+// encode it into OperandToken0
+#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1(SelectedComp) (((SelectedComp)<<D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT)&D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MASK)
+
+// MACROS FOR DETERMINING OPERAND TYPE:
+
+typedef enum D3D10_SB_OPERAND_TYPE
+{
+ D3D10_SB_OPERAND_TYPE_TEMP = 0, // Temporary Register File
+ D3D10_SB_OPERAND_TYPE_INPUT = 1, // General Input Register File
+ D3D10_SB_OPERAND_TYPE_OUTPUT = 2, // General Output Register File
+ D3D10_SB_OPERAND_TYPE_INDEXABLE_TEMP = 3, // Temporary Register File (indexable)
+ D3D10_SB_OPERAND_TYPE_IMMEDIATE32 = 4, // 32bit/component immediate value(s)
+ // If for example, operand token bits
+ // [01:00]==D3D10_SB_OPERAND_4_COMPONENT,
+ // this means that the operand type:
+ // D3D10_SB_OPERAND_TYPE_IMMEDIATE32
+ // results in 4 additional 32bit
+ // DWORDS present for the operand.
+ D3D10_SB_OPERAND_TYPE_IMMEDIATE64 = 5, // 64bit/comp.imm.val(s)HI:LO
+ D3D10_SB_OPERAND_TYPE_SAMPLER = 6, // Reference to sampler state
+ D3D10_SB_OPERAND_TYPE_RESOURCE = 7, // Reference to memory resource (e.g. texture)
+ D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER= 8, // Reference to constant buffer
+ D3D10_SB_OPERAND_TYPE_IMMEDIATE_CONSTANT_BUFFER= 9, // Reference to immediate constant buffer
+ D3D10_SB_OPERAND_TYPE_LABEL = 10, // Label
+ D3D10_SB_OPERAND_TYPE_INPUT_PRIMITIVEID = 11, // Input primitive ID
+ D3D10_SB_OPERAND_TYPE_OUTPUT_DEPTH = 12, // Output Depth
+ D3D10_SB_OPERAND_TYPE_NULL = 13, // Null register, used to discard results of operations
+ // Below Are operands new in DX 10.1
+ D3D10_SB_OPERAND_TYPE_RASTERIZER = 14, // DX10.1 Rasterizer register, used to denote the depth/stencil and render target resources
+ D3D10_SB_OPERAND_TYPE_OUTPUT_COVERAGE_MASK = 15, // DX10.1 PS output MSAA coverage mask (scalar)
+ // Below Are operands new in DX 11
+ D3D11_SB_OPERAND_TYPE_STREAM = 16, // Reference to GS stream output resource
+ D3D11_SB_OPERAND_TYPE_FUNCTION_BODY = 17, // Reference to a function definition
+ D3D11_SB_OPERAND_TYPE_FUNCTION_TABLE = 18, // Reference to a set of functions used by a class
+ D3D11_SB_OPERAND_TYPE_INTERFACE = 19, // Reference to an interface
+ D3D11_SB_OPERAND_TYPE_FUNCTION_INPUT = 20, // Reference to an input parameter to a function
+ D3D11_SB_OPERAND_TYPE_FUNCTION_OUTPUT = 21, // Reference to an output parameter to a function
+ D3D11_SB_OPERAND_TYPE_OUTPUT_CONTROL_POINT_ID = 22, // HS Control Point phase input saying which output control point ID this is
+ D3D11_SB_OPERAND_TYPE_INPUT_FORK_INSTANCE_ID = 23, // HS Fork Phase input instance ID
+ D3D11_SB_OPERAND_TYPE_INPUT_JOIN_INSTANCE_ID = 24, // HS Join Phase input instance ID
+ D3D11_SB_OPERAND_TYPE_INPUT_CONTROL_POINT = 25, // HS Fork+Join, DS phase input control points (array of them)
+ D3D11_SB_OPERAND_TYPE_OUTPUT_CONTROL_POINT = 26, // HS Fork+Join phase output control points (array of them)
+ D3D11_SB_OPERAND_TYPE_INPUT_PATCH_CONSTANT = 27, // DS+HSJoin Input Patch Constants (array of them)
+ D3D11_SB_OPERAND_TYPE_INPUT_DOMAIN_POINT = 28, // DS Input Domain point
+ D3D11_SB_OPERAND_TYPE_THIS_POINTER = 29, // Reference to an interface this pointer
+ D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW = 30, // Reference to UAV u#
+ D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY = 31, // Reference to Thread Group Shared Memory g#
+ D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID = 32, // Compute Shader Thread ID
+ D3D11_SB_OPERAND_TYPE_INPUT_THREAD_GROUP_ID = 33, // Compute Shader Thread Group ID
+ D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP = 34, // Compute Shader Thread ID In Thread Group
+ D3D11_SB_OPERAND_TYPE_INPUT_COVERAGE_MASK = 35, // Pixel shader coverage mask input
+ D3D11_SB_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP_FLATTENED = 36, // Compute Shader Thread ID In Group Flattened to a 1D value.
+ D3D11_SB_OPERAND_TYPE_INPUT_GS_INSTANCE_ID = 37, // Input GS instance ID
+ D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_GREATER_EQUAL = 38, // Output Depth, forced to be greater than or equal than current depth
+ D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_LESS_EQUAL = 39, // Output Depth, forced to be less than or equal to current depth
+ D3D11_SB_OPERAND_TYPE_CYCLE_COUNTER = 40, // Cycle counter
+ D3D11_SB_OPERAND_TYPE_OUTPUT_STENCIL_REF = 41, // DX11 PS output stencil reference (scalar)
+ D3D11_SB_OPERAND_TYPE_INNER_COVERAGE = 42, // DX11 PS input inner coverage (scalar)
+} D3D10_SB_OPERAND_TYPE;
+
+#define D3D10_SB_OPERAND_TYPE_MASK 0x000ff000
+#define D3D10_SB_OPERAND_TYPE_SHIFT 12
+
+// DECODER MACRO: Determine operand type from OperandToken0.
+#define DECODE_D3D10_SB_OPERAND_TYPE(OperandToken0) ((D3D10_SB_OPERAND_TYPE)(((OperandToken0)&D3D10_SB_OPERAND_TYPE_MASK)>>D3D10_SB_OPERAND_TYPE_SHIFT))
+
+// ENCODER MACRO: Store operand type in OperandToken0.
+#define ENCODE_D3D10_SB_OPERAND_TYPE(OperandType) (((OperandType)<<D3D10_SB_OPERAND_TYPE_SHIFT)&D3D10_SB_OPERAND_TYPE_MASK)
+
+typedef enum D3D10_SB_OPERAND_INDEX_DIMENSION
+{
+ D3D10_SB_OPERAND_INDEX_0D = 0, // e.g. Position
+ D3D10_SB_OPERAND_INDEX_1D = 1, // Most common. e.g. Temp registers.
+ D3D10_SB_OPERAND_INDEX_2D = 2, // e.g. Geometry Program Input registers.
+ D3D10_SB_OPERAND_INDEX_3D = 3, // 3D rarely if ever used.
+} D3D10_SB_OPERAND_INDEX_DIMENSION;
+#define D3D10_SB_OPERAND_INDEX_DIMENSION_MASK 0x00300000
+#define D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT 20
+
+// DECODER MACRO: Determine operand index dimension from OperandToken0.
+#define DECODE_D3D10_SB_OPERAND_INDEX_DIMENSION(OperandToken0) ((D3D10_SB_OPERAND_INDEX_DIMENSION)(((OperandToken0)&D3D10_SB_OPERAND_INDEX_DIMENSION_MASK)>>D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT))
+
+// ENCODER MACRO: Store operand index dimension
+// (D3D10_SB_OPERAND_INDEX_DIMENSION enum) in OperandToken0.
+#define ENCODE_D3D10_SB_OPERAND_INDEX_DIMENSION(OperandIndexDim) (((OperandIndexDim)<<D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT)&D3D10_SB_OPERAND_INDEX_DIMENSION_MASK)
+
+typedef enum D3D10_SB_OPERAND_INDEX_REPRESENTATION
+{
+ D3D10_SB_OPERAND_INDEX_IMMEDIATE32 = 0, // Extra DWORD
+ D3D10_SB_OPERAND_INDEX_IMMEDIATE64 = 1, // 2 Extra DWORDs
+ // (HI32:LO32)
+ D3D10_SB_OPERAND_INDEX_RELATIVE = 2, // Extra operand
+ D3D10_SB_OPERAND_INDEX_IMMEDIATE32_PLUS_RELATIVE = 3, // Extra DWORD followed by
+ // extra operand
+ D3D10_SB_OPERAND_INDEX_IMMEDIATE64_PLUS_RELATIVE = 4, // 2 Extra DWORDS
+ // (HI32:LO32) followed
+ // by extra operand
+} D3D10_SB_OPERAND_INDEX_REPRESENTATION;
+#define D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim) (22+3*((Dim)&3))
+#define D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim) (0x3<<D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim))
+
+// DECODER MACRO: Determine from OperandToken0 what representation
+// an operand index is provided as (D3D10_SB_OPERAND_INDEX_REPRESENTATION enum),
+// for index dimension [0], [1] or [2], depending on D3D10_SB_OPERAND_INDEX_DIMENSION.
+#define DECODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION(Dim,OperandToken0) ((D3D10_SB_OPERAND_INDEX_REPRESENTATION)(((OperandToken0)&D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim))>>D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim)))
+
+// ENCODER MACRO: Store in OperandToken0 what representation
+// an operand index is provided as (D3D10_SB_OPERAND_INDEX_REPRESENTATION enum),
+// for index dimension [0], [1] or [2], depending on D3D10_SB_OPERAND_INDEX_DIMENSION.
+#define ENCODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION(Dim,IndexRepresentation) (((IndexRepresentation)<<D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim))&D3D10_SB_OPERAND_INDEX_REPRESENTATION_MASK(Dim))
+
+#define D3D10_SB_OPERAND_EXTENDED_MASK 0x80000000
+#define D3D10_SB_OPERAND_EXTENDED_SHIFT 31
+
+// DECODER MACRO: Determine if the operand is extended
+// by an additional opcode token.
+#define DECODE_IS_D3D10_SB_OPERAND_EXTENDED(OperandToken0) (((OperandToken0)&D3D10_SB_OPERAND_EXTENDED_MASK)>>D3D10_SB_OPERAND_EXTENDED_SHIFT)
+
+// ENCODER MACRO: Store in OperandToken0 whether the operand is extended
+// by an additional operand token.
+#define ENCODE_D3D10_SB_OPERAND_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_EXTENDED_MASK:0)
+
+// ----------------------------------------------------------------------------
+// Extended Instruction Operand Format (OperandToken1)
+//
+// If bit31 of an operand token is set, the
+// operand has additional data in a second DWORD
+// directly following OperandToken0. Other tokens
+// expected for the operand, such as immmediate
+// values or relative address operands (full
+// operands in themselves) always follow
+// OperandToken0 AND OperandToken1..n (extended
+// operand tokens, if present).
+//
+// [05:00] D3D10_SB_EXTENDED_OPERAND_TYPE
+// [16:06] if([05:00] == D3D10_SB_EXTENDED_OPERAND_MODIFIER)
+// {
+// [13:06] D3D10_SB_OPERAND_MODIFIER
+// [16:14] Min Precision: D3D11_SB_OPERAND_MIN_PRECISION
+// [17:17] Non-uniform: D3D12_SB_OPERAND_NON_UNIFORM
+// }
+// else
+// {
+// [17:06] Ignored, 0.
+// }
+// [30:18] Ignored, 0.
+// [31] 0 normally. 1 if second order extended operand definition,
+// meaning next DWORD contains yet ANOTHER extended operand
+// description. Currently no second order extensions defined.
+// This would be useful if a particular extended operand does
+// not have enough space to store the required information in
+// a single token and so is extended further.
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_EXTENDED_OPERAND_TYPE
+{
+ D3D10_SB_EXTENDED_OPERAND_EMPTY = 0, // Might be used if this
+ // enum is full and
+ // further extended opcode
+ // is needed.
+ D3D10_SB_EXTENDED_OPERAND_MODIFIER = 1,
+} D3D10_SB_EXTENDED_OPERAND_TYPE;
+#define D3D10_SB_EXTENDED_OPERAND_TYPE_MASK 0x0000003f
+
+// DECODER MACRO: Given an extended operand
+// token (OperandToken1), figure out what type
+// of token it is (from D3D10_SB_EXTENDED_OPERAND_TYPE enum)
+// to be able to interpret the rest of the token's contents.
+#define DECODE_D3D10_SB_EXTENDED_OPERAND_TYPE(OperandToken1) ((D3D10_SB_EXTENDED_OPERAND_TYPE)((OperandToken1)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK))
+
+// ENCODER MACRO: Store extended operand token
+// type in OperandToken1.
+#define ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE(ExtOperandType) ((ExtOperandType)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK)
+
+typedef enum D3D10_SB_OPERAND_MODIFIER
+{
+ D3D10_SB_OPERAND_MODIFIER_NONE = 0, // Nop. This is the implied
+ // default if the extended
+ // operand is not present for
+ // an operand for which source
+ // modifiers are meaningful
+ D3D10_SB_OPERAND_MODIFIER_NEG = 1, // Negate
+ D3D10_SB_OPERAND_MODIFIER_ABS = 2, // Absolute value, abs()
+ D3D10_SB_OPERAND_MODIFIER_ABSNEG = 3, // -abs()
+} D3D10_SB_OPERAND_MODIFIER;
+#define D3D10_SB_OPERAND_MODIFIER_MASK 0x00003fc0
+#define D3D10_SB_OPERAND_MODIFIER_SHIFT 6
+
+// DECODER MACRO: Given a D3D10_SB_EXTENDED_OPERAND_MODIFIER
+// extended token (OperandToken1), determine the source modifier
+// (D3D10_SB_OPERAND_MODIFIER enum)
+#define DECODE_D3D10_SB_OPERAND_MODIFIER(OperandToken1) ((D3D10_SB_OPERAND_MODIFIER)(((OperandToken1)&D3D10_SB_OPERAND_MODIFIER_MASK)>>D3D10_SB_OPERAND_MODIFIER_SHIFT))
+
+// ENCODER MACRO: Generate a complete source modifier extended token
+// (OperandToken1), given D3D10_SB_OPERAND_MODIFIER enum (the
+// ext. operand type is also set to D3D10_SB_EXTENDED_OPERAND_MODIFIER).
+#define ENCODE_D3D10_SB_EXTENDED_OPERAND_MODIFIER(SourceMod) ((((SourceMod)<<D3D10_SB_OPERAND_MODIFIER_SHIFT)&D3D10_SB_OPERAND_MODIFIER_MASK)| \
+ ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE(D3D10_SB_EXTENDED_OPERAND_MODIFIER) | \
+ ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(0))
+
+// Min precision specifier for source/dest operands. This
+// fits in the extended operand token field. Implementations are free to
+// execute at higher precision than the min - details spec'ed elsewhere.
+// This is part of the opcode specific control range.
+typedef enum D3D11_SB_OPERAND_MIN_PRECISION
+{
+ D3D11_SB_OPERAND_MIN_PRECISION_DEFAULT = 0, // Default precision
+ // for the shader model
+ D3D11_SB_OPERAND_MIN_PRECISION_FLOAT_16 = 1, // Min 16 bit/component float
+ D3D11_SB_OPERAND_MIN_PRECISION_FLOAT_2_8 = 2, // Min 10(2.8)bit/comp. float
+ D3D11_SB_OPERAND_MIN_PRECISION_SINT_16 = 4, // Min 16 bit/comp. signed integer
+ D3D11_SB_OPERAND_MIN_PRECISION_UINT_16 = 5, // Min 16 bit/comp. unsigned integer
+} D3D11_SB_OPERAND_MIN_PRECISION;
+#define D3D11_SB_OPERAND_MIN_PRECISION_MASK 0x0001C000
+#define D3D11_SB_OPERAND_MIN_PRECISION_SHIFT 14
+
+// DECODER MACRO: For an OperandToken1 that can specify
+// a minimum precision for execution, find out what it is.
+#define DECODE_D3D11_SB_OPERAND_MIN_PRECISION(OperandToken1) ((D3D11_SB_OPERAND_MIN_PRECISION)(((OperandToken1)& D3D11_SB_OPERAND_MIN_PRECISION_MASK)>> D3D11_SB_OPERAND_MIN_PRECISION_SHIFT))
+
+// ENCODER MACRO: Encode minimum precision for execution
+// into the extended operand token, OperandToken1
+#define ENCODE_D3D11_SB_OPERAND_MIN_PRECISION(MinPrecision) (((MinPrecision)<< D3D11_SB_OPERAND_MIN_PRECISION_SHIFT)& D3D11_SB_OPERAND_MIN_PRECISION_MASK)
+
+
+// Non-uniform extended operand modifier.
+#define D3D12_SB_OPERAND_NON_UNIFORM_MASK 0x00020000
+#define D3D12_SB_OPERAND_NON_UNIFORM_SHIFT 17
+
+// DECODER MACRO: For an OperandToken1 that can specify a non-uniform operand
+#define DECODE_D3D12_SB_OPERAND_NON_UNIFORM(OperandToken1) (((OperandToken1)& D3D12_SB_OPERAND_NON_UNIFORM_MASK)>> D3D12_SB_OPERAND_NON_UNIFORM_SHIFT)
+
+// ENCODER MACRO: Encode non-uniform state into the extended operand token, OperandToken1
+#define ENCODE_D3D12_SB_OPERAND_NON_UNIFORM(NonUniform) (((NonUniform)<< D3D12_SB_OPERAND_NON_UNIFORM_SHIFT)& D3D12_SB_OPERAND_NON_UNIFORM_MASK)
+
+
+#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK 0x80000000
+#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT 31
+// DECODER MACRO: Determine if an extended operand token
+// (OperandToken1) is further extended by yet another token
+// (OperandToken2). Currently there are no secondary
+// extended operand tokens.
+#define DECODE_IS_D3D10_SB_OPERAND_DOUBLE_EXTENDED(OperandToken1) (((OperandToken1)&D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK)>>D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT)
+
+// ENCODER MACRO: Store in OperandToken1 whether the operand is extended
+// by an additional operand token. Currently there are no secondary
+// extended operand tokens.
+#define ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK:0)
+
+// ----------------------------------------------------------------------------
+// Name Token (NameToken) (used in declaration statements)
+//
+// [15:00] D3D10_SB_NAME enumeration
+// [31:16] Reserved, 0
+//
+// ----------------------------------------------------------------------------
+#define D3D10_SB_NAME_MASK 0x0000ffff
+
+// DECODER MACRO: Get the name from NameToken
+#define DECODE_D3D10_SB_NAME(NameToken) ((D3D10_SB_NAME)((NameToken)&D3D10_SB_NAME_MASK))
+
+// ENCODER MACRO: Generate a complete NameToken given a D3D10_SB_NAME
+#define ENCODE_D3D10_SB_NAME(Name) ((Name)&D3D10_SB_NAME_MASK)
+
+//---------------------------------------------------------------------
+// Declaration Statements
+//
+// Declarations start with a standard opcode token,
+// having opcode type being D3D10_SB_OPCODE_DCL*.
+// Each particular declaration type has custom
+// operand token(s), described below.
+//---------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Global Flags Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_GLOBAL_FLAGS
+// [11:11] Refactoring allowed if bit set.
+// [12:12] Enable double precision float ops.
+// [13:13] Force early depth-stencil test.
+// [14:14] Enable RAW and structured buffers in non-CS 4.x shaders.
+// [15:15] Skip optimizations of shader IL when translating to native code
+// [16:16] Enable minimum-precision data types
+// [17:17] Enable 11.1 double-precision floating-point instruction extensions
+// [18:18] Enable 11.1 non-double instruction extensions
+// [23:19] Reserved for future flags.
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by no operands.
+//
+// ----------------------------------------------------------------------------
+#define D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED (1<<11)
+#define D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS (1<<12)
+#define D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL (1<<13)
+#define D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS (1<<14)
+#define D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION (1<<15)
+#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION (1<<16)
+#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS (1<<17)
+#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS (1<<18)
+#define D3D12_SB_GLOBAL_FLAG_ALL_RESOURCES_BOUND (1<<19)
+
+#define D3D10_SB_GLOBAL_FLAGS_MASK 0x00fff800
+
+// DECODER MACRO: Get global flags
+#define DECODE_D3D10_SB_GLOBAL_FLAGS(OpcodeToken0) ((OpcodeToken0)&D3D10_SB_GLOBAL_FLAGS_MASK)
+
+// ENCODER MACRO: Encode global flags
+#define ENCODE_D3D10_SB_GLOBAL_FLAGS(Flags) ((Flags)&D3D10_SB_GLOBAL_FLAGS_MASK)
+
+// ----------------------------------------------------------------------------
+// Resource Declaration (non multisampled)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_RESOURCE
+// [15:11] D3D10_SB_RESOURCE_DIMENSION
+// [23:16] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Models 4.0 through 5.0:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (t<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of resources in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the t# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (t<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of resource within space (may be dynamically indexed)
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+#define D3D10_SB_RESOURCE_DIMENSION_MASK 0x0000F800
+#define D3D10_SB_RESOURCE_DIMENSION_SHIFT 11
+
+// DECODER MACRO: Given a resource declaration token,
+// (OpcodeToken0), determine the resource dimension
+// (D3D10_SB_RESOURCE_DIMENSION enum)
+#define DECODE_D3D10_SB_RESOURCE_DIMENSION(OpcodeToken0) ((D3D10_SB_RESOURCE_DIMENSION)(((OpcodeToken0)&D3D10_SB_RESOURCE_DIMENSION_MASK)>>D3D10_SB_RESOURCE_DIMENSION_SHIFT))
+
+// ENCODER MACRO: Store resource dimension
+// (D3D10_SB_RESOURCE_DIMENSION enum) into a
+// a resource declaration token (OpcodeToken0)
+#define ENCODE_D3D10_SB_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<<D3D10_SB_RESOURCE_DIMENSION_SHIFT)&D3D10_SB_RESOURCE_DIMENSION_MASK)
+
+// ----------------------------------------------------------------------------
+// Resource Declaration (multisampled)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_RESOURCE (same opcode as non-multisampled case)
+// [15:11] D3D10_SB_RESOURCE_DIMENSION (must be TEXTURE2DMS or TEXTURE2DMSARRAY)
+// [22:16] Sample count 1...127. 0 is currently disallowed, though
+// in future versions 0 could mean "configurable" sample count
+// [23:23] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Models 4.0 through 5.0:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (t<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of resources in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the t# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (t<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of resource within space (may be dynamically indexed)
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+
+// use same macro for encoding/decoding resource dimension aas the non-msaa declaration
+
+#define D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK 0x07F0000
+#define D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT 16
+
+// DECODER MACRO: Given a resource declaration token,
+// (OpcodeToken0), determine the resource sample count (1..127)
+#define DECODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK)>>D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT))
+
+// ENCODER MACRO: Store resource sample count up to 127 into a
+// a resource declaration token (OpcodeToken0)
+#define ENCODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(SampleCount) (((SampleCount > 127 ? 127 : SampleCount)<<D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT)&D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK)
+
+// ----------------------------------------------------------------------------
+// Resource Return Type Token (ResourceReturnTypeToken) (used in resource
+// declaration statements)
+//
+// [03:00] D3D10_SB_RESOURCE_RETURN_TYPE for component X
+// [07:04] D3D10_SB_RESOURCE_RETURN_TYPE for component Y
+// [11:08] D3D10_SB_RESOURCE_RETURN_TYPE for component Z
+// [15:12] D3D10_SB_RESOURCE_RETURN_TYPE for component W
+// [31:16] Reserved, 0
+//
+// ----------------------------------------------------------------------------
+// DECODER MACRO: Get the resource return type for component (0-3) from
+// ResourceReturnTypeToken
+#define DECODE_D3D10_SB_RESOURCE_RETURN_TYPE(ResourceReturnTypeToken, Component) \
+ ((D3D10_SB_RESOURCE_RETURN_TYPE)(((ResourceReturnTypeToken) >> \
+ (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK))
+
+// ENCODER MACRO: Generate a resource return type for a component
+#define ENCODE_D3D10_SB_RESOURCE_RETURN_TYPE(ReturnType, Component) \
+ (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS))
+
+// ----------------------------------------------------------------------------
+// Sampler Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_SAMPLER
+// [14:11] D3D10_SB_SAMPLER_MODE
+// [23:15] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0:
+// (1) Operand starting with OperandToken0, defining which sampler
+// (D3D10_SB_OPERAND_TYPE_SAMPLER) register # is being declared.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// s# register (D3D10_SB_OPERAND_TYPE_SAMPLER) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (s<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of samplers in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the s# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (s<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of sampler within space (may be dynamically indexed)
+// (2) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+typedef enum D3D10_SB_SAMPLER_MODE
+{
+ D3D10_SB_SAMPLER_MODE_DEFAULT = 0,
+ D3D10_SB_SAMPLER_MODE_COMPARISON = 1,
+ D3D10_SB_SAMPLER_MODE_MONO = 2,
+} D3D10_SB_SAMPLER_MODE;
+
+#define D3D10_SB_SAMPLER_MODE_MASK 0x00007800
+#define D3D10_SB_SAMPLER_MODE_SHIFT 11
+
+// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not
+#define DECODE_D3D10_SB_SAMPLER_MODE(OpcodeToken0) ((D3D10_SB_SAMPLER_MODE)(((OpcodeToken0)&D3D10_SB_SAMPLER_MODE_MASK)>>D3D10_SB_SAMPLER_MODE_SHIFT))
+
+// ENCODER MACRO: Generate a resource return type for a component
+#define ENCODE_D3D10_SB_SAMPLER_MODE(SamplerMode) (((SamplerMode)<<D3D10_SB_SAMPLER_MODE_SHIFT)&D3D10_SB_SAMPLER_MODE_MASK)
+
+// ----------------------------------------------------------------------------
+// Input Register Declaration (see separate declarations for Pixel Shaders)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared,
+// including writemask.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Input Register Declaration w/System Interpreted Value
+// (see separate declarations for Pixel Shaders)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT_SIV
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared,
+// including writemask. For Geometry Shaders, the input is
+// v[vertex][attribute], and this declaration is only for which register
+// on the attribute axis is being declared. The vertex axis value must
+// be equal to the # of vertices in the current input primitive for the GS
+// (i.e. 6 for triangle + adjacency).
+// (2) a System Interpreted Value Name (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Input Register Declaration w/System Generated Value
+// (available for all shaders incl. Pixel Shader, no interpolation mode needed)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT_SGV
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared,
+// including writemask.
+// (2) a System Generated Value Name (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Pixel Shader Input Register Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT_PS
+// [14:11] D3D10_SB_INTERPOLATION_MODE
+// [23:15] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared,
+// including writemask.
+//
+// ----------------------------------------------------------------------------
+#define D3D10_SB_INPUT_INTERPOLATION_MODE_MASK 0x00007800
+#define D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT 11
+
+// DECODER MACRO: Find out interpolation mode for the input register
+#define DECODE_D3D10_SB_INPUT_INTERPOLATION_MODE(OpcodeToken0) ((D3D10_SB_INTERPOLATION_MODE)(((OpcodeToken0)&D3D10_SB_INPUT_INTERPOLATION_MODE_MASK)>>D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT))
+
+// ENCODER MACRO: Encode interpolation mode for a register.
+#define ENCODE_D3D10_SB_INPUT_INTERPOLATION_MODE(InterpolationMode) (((InterpolationMode)<<D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT)&D3D10_SB_INPUT_INTERPOLATION_MODE_MASK)
+
+// ----------------------------------------------------------------------------
+// Pixel Shader Input Register Declaration w/System Interpreted Value
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT_PS_SIV
+// [14:11] D3D10_SB_INTERPOLATION_MODE
+// [23:15] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared.
+// (2) a System Interpreted Value Name (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Pixel Shader Input Register Declaration w/System Generated Value
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INPUT_PS_SGV
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) Operand, starting with OperandToken0, defining which input
+// v# register (D3D10_SB_OPERAND_TYPE_INPUT) is being declared.
+// (2) a System Generated Value Name (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Output Register Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_OUTPUT
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand:
+// (1) Operand, starting with OperandToken0, defining which
+// o# register (D3D10_SB_OPERAND_TYPE_OUTPUT) is being declared,
+// including writemask.
+// (in Pixel Shader, output can also be one of
+// D3D10_SB_OPERAND_TYPE_OUTPUT_DEPTH,
+// D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_GREATER_EQUAL, or
+// D3D11_SB_OPERAND_TYPE_OUTPUT_DEPTH_LESS_EQUAL )
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Output Register Declaration w/System Interpreted Value
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_OUTPUT_SIV
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// o# register (D3D10_SB_OPERAND_TYPE_OUTPUT) is being declared,
+// including writemask.
+// (2) a System Interpreted Name token (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Output Register Declaration w/System Generated Value
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_OUTPUT_SGV
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// o# register (D3D10_SB_OPERAND_TYPE_OUTPUT) is being declared,
+// including writemask.
+// (2) a System Generated Name token (NameToken)
+//
+// ----------------------------------------------------------------------------
+
+
+// ----------------------------------------------------------------------------
+// Input or Output Register Indexing Range Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INDEX_RANGE
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// input (v#) or output (o#) register is having its array indexing range
+// declared, including writemask. For Geometry Shader inputs,
+// it is assumed that the vertex axis is always fully indexable,
+// and 0 must be specified as the vertex# in this declaration, so that
+// only the a range of attributes are having their index range defined.
+//
+// (2) a DWORD representing the count of registers starting from the one
+// indicated in (1).
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Temp Register Declaration r0...r(n-1)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_TEMPS
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand:
+// (1) DWORD (unsigned int) indicating how many temps are being declared.
+// i.e. 5 means r0...r4 are declared.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Indexable Temp Register (x#[size]) Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INDEXABLE_TEMP
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 3 DWORDs:
+// (1) Register index (defines which x# register is declared)
+// (2) Number of registers in this register bank
+// (3) Number of components in the array (1-4). 1 means .x, 2 means .xy etc.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Constant Buffer Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_CONSTANT_BUFFER
+// [11] D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN
+// [23:12] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand on Shader Model 4.0 through 5.0:
+// (1) Operand, starting with OperandToken0, defining which CB slot (cb#[size])
+// is being declared. (operand type: D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER)
+// The indexing dimension for the register must be
+// D3D10_SB_OPERAND_INDEX_DIMENSION_2D, where the first index specifies
+// which cb#[] is being declared, and the second (array) index specifies the size
+// of the buffer, as a count of 32-bit*4 elements. (As opposed to when the
+// cb#[] is used in shader instructions, and the array index represents which
+// location in the constant buffer is being referenced.)
+// If the size is specified as 0, the CB size is not known (any size CB
+// can be bound to the slot).
+//
+// The order of constant buffer declarations in a shader indicates their
+// relative priority from highest to lowest (hint to driver).
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) Operand, starting with OperandToken0, defining which CB range (ID and bounds)
+// is being declared. (operand type: D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER)
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (cb<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of constant buffers in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the cb#[] is used in shader instructions: (cb<id>[<idx>][<loc>])
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of constant buffer within space (may be dynamically indexed)
+// 3 <loc>: location of vector within constant buffer being referenced,
+// which may also be dynamically indexed, with no access pattern flag required.
+// (2) a DWORD indicating the size of the constant buffer as a count of 16-byte vectors.
+// Each vector is 32-bit*4 elements == 128-bits == 16 bytes.
+// If the size is specified as 0, the CB size is not known (any size CB
+// can be bound to the slot).
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN
+{
+ D3D10_SB_CONSTANT_BUFFER_IMMEDIATE_INDEXED = 0,
+ D3D10_SB_CONSTANT_BUFFER_DYNAMIC_INDEXED = 1
+} D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN;
+
+#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK 0x00000800
+#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT 11
+
+// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not
+#define DECODE_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(OpcodeToken0) ((D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN)(((OpcodeToken0)&D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK)>>D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT))
+
+// ENCODER MACRO: Encode the access pattern for the Constant Buffer
+#define ENCODE_D3D10_SB_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(AccessPattern) (((AccessPattern)<<D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT)&D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK)
+
+// ----------------------------------------------------------------------------
+// Immediate Constant Buffer Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_CUSTOMDATA
+// [31:11] == D3D10_SB_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER
+//
+// OpcodeToken0 is followed by:
+// (1) DWORD indicating length of declaration, including OpcodeToken0.
+// This length must = 2(for OpcodeToken0 and 1) + a multiple of 4
+// (# of immediate constants)
+// (2) Sequence of 4-tuples of DWORDs defining the Immediate Constant Buffer.
+// The number of 4-tuples is (length above - 1) / 4
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Shader Message Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_CUSTOMDATA
+// [31:11] == D3D11_SB_CUSTOMDATA_SHADER_MESSAGE
+//
+// OpcodeToken0 is followed by:
+// (1) DWORD indicating length of declaration, including OpcodeToken0.
+// (2) DWORD (D3D11_SB_SHADER_MESSAGE_ID) indicating shader message or error.
+// (3) D3D11_SB_SHADER_MESSAGE_FORMAT indicating the convention for formatting the message.
+// (4) DWORD indicating the number of characters in the string without the terminator.
+// (5) DWORD indicating the number of operands.
+// (6) DWORD indicating length of operands.
+// (7) Encoded operands.
+// (8) String with trailing zero, padded to a multiple of DWORDs.
+// The string is in the given format and the operands given should
+// be used for argument substitutions when formatting.
+// ----------------------------------------------------------------------------
+
+typedef enum D3D11_SB_SHADER_MESSAGE_ID
+{
+ D3D11_SB_SHADER_MESSAGE_ID_MESSAGE = 0x00200102,
+ D3D11_SB_SHADER_MESSAGE_ID_ERROR = 0x00200103
+} D3D11_SB_SHADER_MESSAGE_ID;
+
+typedef enum D3D11_SB_SHADER_MESSAGE_FORMAT
+{
+ // No formatting, just a text string. Operands are ignored.
+ D3D11_SB_SHADER_MESSAGE_FORMAT_ANSI_TEXT,
+ // Format string follows C/C++ printf conventions.
+ D3D11_SB_SHADER_MESSAGE_FORMAT_ANSI_PRINTF,
+} D3D11_SB_SHADER_MESSAGE_FORMAT;
+
+// ----------------------------------------------------------------------------
+// Shader Clip Plane Constant Mappings for DX9 hardware
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_CUSTOMDATA
+// [31:11] == D3D11_SB_CUSTOMDATA_SHADER_CLIP_PLANE_CONSTANT_MAPPINGS_FOR_DX9
+//
+// OpcodeToken0 is followed by:
+// (1) DWORD indicating length of declaration, including OpcodeToken0.
+// (2) DWORD indicating number of constant mappings (up to 6 mappings).
+// (3+) Constant mapping tables in following format.
+//
+// struct _Clip_Plane_Constant_Mapping
+// {
+// WORD ConstantBufferIndex; // cb[n]
+// WORD StartConstantElement; // starting index of cb[n][m]
+// WORD ConstantElemntCount; // number of elements cb[n][m] ~ cb[n][m+l]
+// WORD Reserved; //
+// };
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Geometry Shader Input Primitive Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_GS_INPUT_PRIMITIVE
+// [16:11] D3D10_SB_PRIMITIVE [not D3D10_SB_PRIMITIVE_TOPOLOGY]
+// [23:17] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+
+#define D3D10_SB_GS_INPUT_PRIMITIVE_MASK 0x0001f800
+#define D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT 11
+
+// DECODER MACRO: Given a primitive topology declaration,
+// (OpcodeToken0), determine the primitive topology
+// (D3D10_SB_PRIMITIVE enum)
+#define DECODE_D3D10_SB_GS_INPUT_PRIMITIVE(OpcodeToken0) ((D3D10_SB_PRIMITIVE)(((OpcodeToken0)&D3D10_SB_GS_INPUT_PRIMITIVE_MASK)>>D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT))
+
+// ENCODER MACRO: Store primitive topology
+// (D3D10_SB_PRIMITIVE enum) into a
+// a primitive topology declaration token (OpcodeToken0)
+#define ENCODE_D3D10_SB_GS_INPUT_PRIMITIVE(Prim) (((Prim)<<D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT)&D3D10_SB_GS_INPUT_PRIMITIVE_MASK)
+
+// ----------------------------------------------------------------------------
+// Geometry Shader Output Topology Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY
+// [17:11] D3D10_SB_PRIMITIVE_TOPOLOGY
+// [23:18] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+
+#define D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK 0x0001f800
+#define D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT 11
+
+// DECODER MACRO: Given a primitive topology declaration,
+// (OpcodeToken0), determine the primitive topology
+// (D3D10_SB_PRIMITIVE_TOPOLOGY enum)
+#define DECODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY(OpcodeToken0) ((D3D10_SB_PRIMITIVE_TOPOLOGY)(((OpcodeToken0)&D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK)>>D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT))
+
+// ENCODER MACRO: Store primitive topology
+// (D3D10_SB_PRIMITIVE_TOPOLOGY enum) into a
+// a primitive topology declaration token (OpcodeToken0)
+#define ENCODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY(PrimTopology) (((PrimTopology)<<D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT)&D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_MASK)
+
+// ----------------------------------------------------------------------------
+// Geometry Shader Maximum Output Vertex Count Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by a DWORD representing the
+// maximum number of primitives that could be output
+// by the Geometry Shader.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Geometry Shader Instance Count Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_GS_INSTANCE_COUNT
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by a UINT32 representing the
+// number of instances of the geometry shader program to execute.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: HS/DS Input Control Point Count
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_INPUT_CONTROL_POINT_COUNT
+// [16:11] Control point count
+// [23:17] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+#define D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK 0x0001f800
+#define D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT 11
+
+// DECODER MACRO: Given an input control point count declaration token,
+// (OpcodeToken0), determine the control point count
+#define DECODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK)>>D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT))
+
+// ENCODER MACRO: Store input control point count into a declaration token
+#define ENCODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(Count) (((Count)<<D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT)&D3D11_SB_INPUT_CONTROL_POINT_COUNT_MASK)
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: HS Output Control Point Count
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_OUTPUT_CONTROL_POINT_COUNT
+// [16:11] Control point count
+// [23:17] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+#define D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK 0x0001f800
+#define D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT 11
+
+// DECODER MACRO: Given an output control point count declaration token,
+// (OpcodeToken0), determine the control point count
+#define DECODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK)>>D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT))
+
+// ENCODER MACRO: Store output control point count into a declaration token
+#define ENCODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(Count) (((Count)<<D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT)&D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_MASK)
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: Tessellator Domain
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_TESS_DOMAIN
+// [12:11] Domain
+// [23:13] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+typedef enum D3D11_SB_TESSELLATOR_DOMAIN
+{
+ D3D11_SB_TESSELLATOR_DOMAIN_UNDEFINED = 0,
+ D3D11_SB_TESSELLATOR_DOMAIN_ISOLINE = 1,
+ D3D11_SB_TESSELLATOR_DOMAIN_TRI = 2,
+ D3D11_SB_TESSELLATOR_DOMAIN_QUAD = 3
+} D3D11_SB_TESSELLATOR_DOMAIN;
+
+#define D3D11_SB_TESS_DOMAIN_MASK 0x00001800
+#define D3D11_SB_TESS_DOMAIN_SHIFT 11
+
+// DECODER MACRO: Given a tessellator domain declaration,
+// (OpcodeToken0), determine the domain
+// (D3D11_SB_TESSELLATOR_DOMAIN enum)
+#define DECODE_D3D11_SB_TESS_DOMAIN(OpcodeToken0) ((D3D11_SB_TESSELLATOR_DOMAIN)(((OpcodeToken0)&D3D11_SB_TESS_DOMAIN_MASK)>>D3D11_SB_TESS_DOMAIN_SHIFT))
+
+// ENCODER MACRO: Store tessellator domain
+// (D3D11_SB_TESSELLATOR_DOMAIN enum) into a
+// a tessellator domain declaration token (OpcodeToken0)
+#define ENCODE_D3D11_SB_TESS_DOMAIN(Domain) (((Domain)<<D3D11_SB_TESS_DOMAIN_SHIFT)&D3D11_SB_TESS_DOMAIN_MASK)
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: Tessellator Partitioning
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_TESS_PARTITIONING
+// [13:11] Partitioning
+// [23:14] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+typedef enum D3D11_SB_TESSELLATOR_PARTITIONING
+{
+ D3D11_SB_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
+ D3D11_SB_TESSELLATOR_PARTITIONING_INTEGER = 1,
+ D3D11_SB_TESSELLATOR_PARTITIONING_POW2 = 2,
+ D3D11_SB_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3,
+ D3D11_SB_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4
+} D3D11_SB_TESSELLATOR_PARTITIONING;
+
+#define D3D11_SB_TESS_PARTITIONING_MASK 0x00003800
+#define D3D11_SB_TESS_PARTITIONING_SHIFT 11
+
+// DECODER MACRO: Given a tessellator partitioning declaration,
+// (OpcodeToken0), determine the domain
+// (D3D11_SB_TESSELLATOR_PARTITIONING enum)
+#define DECODE_D3D11_SB_TESS_PARTITIONING(OpcodeToken0) ((D3D11_SB_TESSELLATOR_PARTITIONING)(((OpcodeToken0)&D3D11_SB_TESS_PARTITIONING_MASK)>>D3D11_SB_TESS_PARTITIONING_SHIFT))
+
+// ENCODER MACRO: Store tessellator partitioning
+// (D3D11_SB_TESSELLATOR_PARTITIONING enum) into a
+// a tessellator partitioning declaration token (OpcodeToken0)
+#define ENCODE_D3D11_SB_TESS_PARTITIONING(Partitioning) (((Partitioning)<<D3D11_SB_TESS_PARTITIONING_SHIFT)&D3D11_SB_TESS_PARTITIONING_MASK)
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: Tessellator Output Primitive
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_TESS_OUTPUT_PRIMITIVE
+// [13:11] Output Primitive
+// [23:14] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token. == 1
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// ----------------------------------------------------------------------------
+typedef enum D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE
+{
+ D3D11_SB_TESSELLATOR_OUTPUT_UNDEFINED = 0,
+ D3D11_SB_TESSELLATOR_OUTPUT_POINT = 1,
+ D3D11_SB_TESSELLATOR_OUTPUT_LINE = 2,
+ D3D11_SB_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3,
+ D3D11_SB_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4
+} D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE;
+
+#define D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK 0x00003800
+#define D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT 11
+
+// DECODER MACRO: Given a tessellator output primitive declaration,
+// (OpcodeToken0), determine the domain
+// (D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE enum)
+#define DECODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE(OpcodeToken0) ((D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE)(((OpcodeToken0)&D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK)>>D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT))
+
+// ENCODER MACRO: Store tessellator output primitive
+// (D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE enum) into a
+// a tessellator output primitive declaration token (OpcodeToken0)
+#define ENCODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE(OutputPrimitive) (((OutputPrimitive)<<D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT)&D3D11_SB_TESS_OUTPUT_PRIMITIVE_MASK)
+
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: Hull Shader Max Tessfactor
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_HS_MAX_TESSFACTOR
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by a float32 representing the
+// maximum TessFactor.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Hull Shader Declaration Phase: Hull Shader Fork Phase Instance Count
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by a UINT32 representing the
+// number of instances of the current fork phase program to execute.
+//
+// ----------------------------------------------------------------------------
+
+typedef enum D3D10_SB_INTERPOLATION_MODE
+{
+ D3D10_SB_INTERPOLATION_UNDEFINED = 0,
+ D3D10_SB_INTERPOLATION_CONSTANT = 1,
+ D3D10_SB_INTERPOLATION_LINEAR = 2,
+ D3D10_SB_INTERPOLATION_LINEAR_CENTROID = 3,
+ D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4,
+ D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5,
+ D3D10_SB_INTERPOLATION_LINEAR_SAMPLE = 6, // DX10.1
+ D3D10_SB_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7, // DX10.1
+} D3D10_SB_INTERPOLATION_MODE;
+
+// Keep PRIMITIVE_TOPOLOGY values in sync with earlier DX versions (HW consumes values directly).
+typedef enum D3D10_SB_PRIMITIVE_TOPOLOGY
+{
+ D3D10_SB_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_LINELIST = 2,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
+ // 6 is reserved for legacy triangle fans
+ // Adjacency values should be equal to (0x8 & non-adjacency):
+ D3D10_SB_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
+ D3D10_SB_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13,
+} D3D10_SB_PRIMITIVE_TOPOLOGY;
+
+typedef enum D3D10_SB_PRIMITIVE
+{
+ D3D10_SB_PRIMITIVE_UNDEFINED = 0,
+ D3D10_SB_PRIMITIVE_POINT = 1,
+ D3D10_SB_PRIMITIVE_LINE = 2,
+ D3D10_SB_PRIMITIVE_TRIANGLE = 3,
+ // Adjacency values should be equal to (0x4 & non-adjacency):
+ D3D10_SB_PRIMITIVE_LINE_ADJ = 6,
+ D3D10_SB_PRIMITIVE_TRIANGLE_ADJ = 7,
+ D3D11_SB_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
+ D3D11_SB_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
+ D3D11_SB_PRIMITIVE_3_CONTROL_POINT_PATCH = 10,
+ D3D11_SB_PRIMITIVE_4_CONTROL_POINT_PATCH = 11,
+ D3D11_SB_PRIMITIVE_5_CONTROL_POINT_PATCH = 12,
+ D3D11_SB_PRIMITIVE_6_CONTROL_POINT_PATCH = 13,
+ D3D11_SB_PRIMITIVE_7_CONTROL_POINT_PATCH = 14,
+ D3D11_SB_PRIMITIVE_8_CONTROL_POINT_PATCH = 15,
+ D3D11_SB_PRIMITIVE_9_CONTROL_POINT_PATCH = 16,
+ D3D11_SB_PRIMITIVE_10_CONTROL_POINT_PATCH = 17,
+ D3D11_SB_PRIMITIVE_11_CONTROL_POINT_PATCH = 18,
+ D3D11_SB_PRIMITIVE_12_CONTROL_POINT_PATCH = 19,
+ D3D11_SB_PRIMITIVE_13_CONTROL_POINT_PATCH = 20,
+ D3D11_SB_PRIMITIVE_14_CONTROL_POINT_PATCH = 21,
+ D3D11_SB_PRIMITIVE_15_CONTROL_POINT_PATCH = 22,
+ D3D11_SB_PRIMITIVE_16_CONTROL_POINT_PATCH = 23,
+ D3D11_SB_PRIMITIVE_17_CONTROL_POINT_PATCH = 24,
+ D3D11_SB_PRIMITIVE_18_CONTROL_POINT_PATCH = 25,
+ D3D11_SB_PRIMITIVE_19_CONTROL_POINT_PATCH = 26,
+ D3D11_SB_PRIMITIVE_20_CONTROL_POINT_PATCH = 27,
+ D3D11_SB_PRIMITIVE_21_CONTROL_POINT_PATCH = 28,
+ D3D11_SB_PRIMITIVE_22_CONTROL_POINT_PATCH = 29,
+ D3D11_SB_PRIMITIVE_23_CONTROL_POINT_PATCH = 30,
+ D3D11_SB_PRIMITIVE_24_CONTROL_POINT_PATCH = 31,
+ D3D11_SB_PRIMITIVE_25_CONTROL_POINT_PATCH = 32,
+ D3D11_SB_PRIMITIVE_26_CONTROL_POINT_PATCH = 33,
+ D3D11_SB_PRIMITIVE_27_CONTROL_POINT_PATCH = 34,
+ D3D11_SB_PRIMITIVE_28_CONTROL_POINT_PATCH = 35,
+ D3D11_SB_PRIMITIVE_29_CONTROL_POINT_PATCH = 36,
+ D3D11_SB_PRIMITIVE_30_CONTROL_POINT_PATCH = 37,
+ D3D11_SB_PRIMITIVE_31_CONTROL_POINT_PATCH = 38,
+ D3D11_SB_PRIMITIVE_32_CONTROL_POINT_PATCH = 39,
+} D3D10_SB_PRIMITIVE;
+
+typedef enum D3D10_SB_COMPONENT_MASK
+{
+ D3D10_SB_COMPONENT_MASK_X = 1,
+ D3D10_SB_COMPONENT_MASK_Y = 2,
+ D3D10_SB_COMPONENT_MASK_Z = 4,
+ D3D10_SB_COMPONENT_MASK_W = 8,
+ D3D10_SB_COMPONENT_MASK_R = 1,
+ D3D10_SB_COMPONENT_MASK_G = 2,
+ D3D10_SB_COMPONENT_MASK_B = 4,
+ D3D10_SB_COMPONENT_MASK_A = 8,
+ D3D10_SB_COMPONENT_MASK_ALL = 15,
+} D3D10_SB_COMPONENT_MASK;
+
+typedef enum D3D10_SB_NAME
+{
+ D3D10_SB_NAME_UNDEFINED = 0,
+ D3D10_SB_NAME_POSITION = 1,
+ D3D10_SB_NAME_CLIP_DISTANCE = 2,
+ D3D10_SB_NAME_CULL_DISTANCE = 3,
+ D3D10_SB_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
+ D3D10_SB_NAME_VIEWPORT_ARRAY_INDEX = 5,
+ D3D10_SB_NAME_VERTEX_ID = 6,
+ D3D10_SB_NAME_PRIMITIVE_ID = 7,
+ D3D10_SB_NAME_INSTANCE_ID = 8,
+ D3D10_SB_NAME_IS_FRONT_FACE = 9,
+ D3D10_SB_NAME_SAMPLE_INDEX = 10,
+ // The following are added for D3D11
+ D3D11_SB_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR = 11,
+ D3D11_SB_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR = 12,
+ D3D11_SB_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR = 13,
+ D3D11_SB_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR = 14,
+ D3D11_SB_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR = 15,
+ D3D11_SB_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR = 16,
+ D3D11_SB_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR = 17,
+ D3D11_SB_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR = 18,
+ D3D11_SB_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR = 19,
+ D3D11_SB_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 20,
+ D3D11_SB_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 21,
+ D3D11_SB_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 22,
+ // The following are added for D3D12
+ D3D12_SB_NAME_BARYCENTRICS = 23,
+ D3D12_SB_NAME_SHADINGRATE = 24,
+ D3D12_SB_NAME_CULLPRIMITIVE = 25,
+} D3D10_SB_NAME;
+
+typedef enum D3D10_SB_RESOURCE_DIMENSION
+{
+ D3D10_SB_RESOURCE_DIMENSION_UNKNOWN = 0,
+ D3D10_SB_RESOURCE_DIMENSION_BUFFER = 1,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE1D = 2,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE2D = 3,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMS = 4,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE3D = 5,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBE = 6,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE1DARRAY = 7,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DARRAY = 8,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURE2DMSARRAY = 9,
+ D3D10_SB_RESOURCE_DIMENSION_TEXTURECUBEARRAY = 10,
+ D3D11_SB_RESOURCE_DIMENSION_RAW_BUFFER = 11,
+ D3D11_SB_RESOURCE_DIMENSION_STRUCTURED_BUFFER = 12,
+} D3D10_SB_RESOURCE_DIMENSION;
+
+typedef enum D3D10_SB_RESOURCE_RETURN_TYPE
+{
+ D3D10_SB_RETURN_TYPE_UNORM = 1,
+ D3D10_SB_RETURN_TYPE_SNORM = 2,
+ D3D10_SB_RETURN_TYPE_SINT = 3,
+ D3D10_SB_RETURN_TYPE_UINT = 4,
+ D3D10_SB_RETURN_TYPE_FLOAT = 5,
+ D3D10_SB_RETURN_TYPE_MIXED = 6,
+ D3D11_SB_RETURN_TYPE_DOUBLE = 7,
+ D3D11_SB_RETURN_TYPE_CONTINUED = 8,
+ D3D11_SB_RETURN_TYPE_UNUSED = 9,
+} D3D10_SB_RESOURCE_RETURN_TYPE;
+
+typedef enum D3D10_SB_REGISTER_COMPONENT_TYPE
+{
+ D3D10_SB_REGISTER_COMPONENT_UNKNOWN = 0,
+ D3D10_SB_REGISTER_COMPONENT_UINT32 = 1,
+ D3D10_SB_REGISTER_COMPONENT_SINT32 = 2,
+ D3D10_SB_REGISTER_COMPONENT_FLOAT32 = 3
+} D3D10_SB_REGISTER_COMPONENT_TYPE;
+
+typedef enum D3D10_SB_INSTRUCTION_RETURN_TYPE
+{
+ D3D10_SB_INSTRUCTION_RETURN_FLOAT = 0,
+ D3D10_SB_INSTRUCTION_RETURN_UINT = 1
+} D3D10_SB_INSTRUCTION_RETURN_TYPE;
+
+#define D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK 0x00001800
+#define D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT 11
+
+// DECODER MACRO: For an OpcodeToken0 with the return type
+// determine the return type.
+#define DECODE_D3D10_SB_INSTRUCTION_RETURN_TYPE(OpcodeToken0) ((D3D10_SB_INSTRUCTION_RETURN_TYPE)(((OpcodeToken0)&D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK)>>D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT))
+// ENCODER MACRO: Encode the return type for instructions
+// in the opcode specific control range of OpcodeToken0
+#define ENCODE_D3D10_SB_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<<D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT)&D3D10_SB_INSTRUCTION_RETURN_TYPE_MASK)
+
+// ----------------------------------------------------------------------------
+// Interface function body Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_FUNCTION_BODY
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. If it is extended, then
+// it contains the actual instruction length in DWORDs, since
+// it may not fit into 7 bits if enough operands are defined.
+//
+// OpcodeToken0 is followed by a DWORD that represents the function body
+// identifier.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Interface function table Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_FUNCTION_TABLE
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. If it is extended, then
+// it contains the actual instruction length in DWORDs, since
+// it may not fit into 7 bits if enough functions are defined.
+//
+// OpcodeToken0 is followed by a DWORD that represents the function table
+// identifier and another DWORD (TableLength) that gives the number of
+// functions in the table.
+//
+// This is followed by TableLength DWORDs which are function body indices.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Interface Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_DCL_INTERFACE
+// [11] 1 if the interface is indexed dynamically, 0 otherwise.
+// [23:12] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. If it is extended, then
+// it contains the actual instruction length in DWORDs, since
+// it may not fit into 7 bits if enough types are used.
+//
+// OpcodeToken0 is followed by a DWORD that represents the interface
+// identifier. Next is a DWORD that gives the expected function table
+// length. Then another DWORD (OpcodeToken3) with the following layout:
+//
+// [15:00] TableLength, the number of types that implement this interface
+// [31:16] ArrayLength, the number of interfaces that are defined in this array.
+//
+// This is followed by TableLength DWORDs which are function table
+// identifiers, representing possible tables for a given interface.
+//
+// ----------------------------------------------------------------------------
+
+#define D3D11_SB_INTERFACE_INDEXED_BIT_MASK 0x00000800
+#define D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT 11
+
+#define D3D11_SB_INTERFACE_TABLE_LENGTH_MASK 0x0000ffff
+#define D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT 0
+
+#define D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK 0xffff0000
+#define D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT 16
+
+// get/set the indexed bit for an interface definition
+#define DECODE_D3D11_SB_INTERFACE_INDEXED_BIT(OpcodeToken0) ((((OpcodeToken0)&D3D11_SB_INTERFACE_INDEXED_BIT_MASK)>>D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT) ? true : false)
+#define ENCODE_D3D11_SB_INTERFACE_INDEXED_BIT(IndexedBit) (((IndexedBit)<<D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT)&D3D11_SB_INTERFACE_INDEXED_BIT_MASK)
+
+// get/set the table length for an interface definition
+#define DECODE_D3D11_SB_INTERFACE_TABLE_LENGTH(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D11_SB_INTERFACE_TABLE_LENGTH_MASK)>>D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT))
+#define ENCODE_D3D11_SB_INTERFACE_TABLE_LENGTH(TableLength) (((TableLength)<<D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT)&D3D11_SB_INTERFACE_TABLE_LENGTH_MASK)
+
+// get/set the array length for an interface definition
+#define DECODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK)>>D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT))
+#define ENCODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(ArrayLength) (((ArrayLength)<<D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT)&D3D11_SB_INTERFACE_ARRAY_LENGTH_MASK)
+
+// ----------------------------------------------------------------------------
+// Interface call
+//
+// OpcodeToken0:
+//
+// [10:00] D3D10_SB_OPCODE_INTERFACE_CALL
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. If it is extended, then
+// it contains the actual instruction length in DWORDs, since
+// it may not fit into 7 bits if enough types are used.
+//
+// OpcodeToken0 is followed by a DWORD that gives the function index to
+// call in the function table specified for the given interface.
+// Next is the interface operand.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Thread Group Declaration (Compute Shader)
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. If it is extended, then
+// it contains the actual instruction length in DWORDs, since
+// it may not fit into 7 bits if enough types are used.
+//
+// OpcodeToken0 is followed by 3 DWORDs, the Thread Group dimensions as UINT32:
+// x, y, z
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Typed Unordered Access View Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_TYPED
+// [15:11] D3D10_SB_RESOURCE_DIMENSION
+// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT)
+// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0
+// [23:18] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Models 4.0 through 5.0:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared.
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (u<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of UAV's in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the u# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (u<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of uav within space (may be dynamically indexed)
+// (2) a Resource Return Type token (ResourceReturnTypeToken)
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+// UAV access scope flags
+#define D3D11_SB_GLOBALLY_COHERENT_ACCESS 0x00010000
+#define D3D11_SB_ACCESS_COHERENCY_MASK 0x00010000
+
+// DECODER MACRO: Retrieve flags for sync instruction from OpcodeToken0.
+#define DECODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_ACCESS_COHERENCY_MASK)
+
+// ENCODER MACRO: Given a set of sync instruciton flags, encode them in OpcodeToken0.
+#define ENCODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(Flags) ((Flags)&D3D11_SB_ACCESS_COHERENCY_MASK)
+
+// Additional UAV access flags
+#define D3D11_SB_RASTERIZER_ORDERED_ACCESS 0x00020000
+
+// Resource flags mask. Use to retrieve all resource flags, including the order preserving counter.
+#define D3D11_SB_RESOURCE_FLAGS_MASK (D3D11_SB_GLOBALLY_COHERENT_ACCESS|D3D11_SB_RASTERIZER_ORDERED_ACCESS|D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER)
+
+// DECODER MACRO: Retrieve UAV access flags for from OpcodeToken0.
+#define DECODE_D3D11_SB_RESOURCE_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_RESOURCE_FLAGS_MASK)
+
+// ENCODER MACRO: Given UAV access flags, encode them in OpcodeToken0.
+#define ENCODE_D3D11_SB_RESOURCE_FLAGS(Flags) ((Flags)&D3D11_SB_RESOURCE_FLAGS_MASK)
+
+// ----------------------------------------------------------------------------
+// Raw Unordered Access View Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW
+// [15:11] Ignored, 0
+// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT)
+// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0
+// [23:18] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (u<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of UAV's in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the u# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (u<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of uav within space (may be dynamically indexed)
+// (2) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Structured Unordered Access View Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED
+// [15:11] Ignored, 0
+// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT)
+// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0
+// [22:18] Ignored, 0
+// [23:23] D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER or 0
+//
+// The presence of this flag means that if a UAV is bound to the
+// corresponding slot, it must have been created with
+// D3D11_BUFFER_UAV_FLAG_COUNTER at the API. Also, the shader
+// can contain either imm_atomic_alloc or _consume instructions
+// operating on the given UAV.
+//
+// If this flag is not present, the shader can still contain
+// either imm_atomic_alloc or imm_atomic_consume instructions for
+// this UAV. But if such instructions are present in this case,
+// and a UAV is bound corresponding slot, it must have been created
+// with the D3D11_BUFFER_UAV_FLAG_APPEND flag at the API.
+// Append buffers have a counter as well, but values returned
+// to the shader are only valid for the lifetime of the shader
+// invocation.
+//
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is
+// being declared.
+// (2) a DWORD indicating UINT32 byte stride
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (u<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of UAV's in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the u# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (u<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of uav within space (may be dynamically indexed)
+// (2) a DWORD indicating UINT32 byte stride
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+// UAV flags
+#define D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER 0x00800000
+#define D3D11_SB_UAV_FLAGS_MASK 0x00800000
+
+// DECODER MACRO: Retrieve flags about UAV from OpcodeToken0.
+#define DECODE_D3D11_SB_UAV_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_UAV_FLAGS_MASK)
+
+// ENCODER MACRO: Given a set of UAV flags, encode them in OpcodeToken0.
+#define ENCODE_D3D11_SB_UAV_FLAGS(Flags) ((Flags)&D3D11_SB_UAV_FLAGS_MASK)
+
+// ----------------------------------------------------------------------------
+// Raw Thread Group Shared Memory Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_RAW
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is being declared.
+// (2) a DWORD indicating the byte count, which must be a multiple of 4.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Structured Thread Group Shared Memory Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 3 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is
+// being declared.
+// (2) a DWORD indicating UINT32 struct byte stride
+// (3) a DWORD indicating UINT32 struct count
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Raw Shader Resource View Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_RAW
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 1 operand:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+//
+// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (t<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of resources in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the t# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (t<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of resource within space (may be dynamically indexed)
+// (2) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// Structured Shader Resource View Declaration
+//
+// OpcodeToken0:
+//
+// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_STRUCTURED
+// [23:11] Ignored, 0
+// [30:24] Instruction length in DWORDs including the opcode token.
+// [31] 0 normally. 1 if extended operand definition, meaning next DWORD
+// contains extended operand description. This dcl is currently not
+// extended.
+//
+// OpcodeToken0 is followed by 2 operands:
+// (1) an operand, starting with OperandToken0, defining which
+// g# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is
+// being declared.
+// (2) a DWORD indicating UINT32 struct byte stride
+//
+// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later:
+// (1) an operand, starting with OperandToken0, defining which
+// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared.
+// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D,
+// and the meaning of the index dimensions are as follows: (t<id>[<lbound>:<ubound>])
+// 1 <id>: variable ID being declared
+// 2 <lbound>: the lower bound of the range of resources in the space
+// 3 <ubound>: the upper bound (inclusive) of this range
+// As opposed to when the t# is used in shader instructions, where the register
+// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index
+// dimensions are as follows: (t<id>[<idx>]):
+// 1 <id>: variable ID being used (matches dcl)
+// 2 <idx>: absolute index of resource within space (may be dynamically indexed)
+// (2) a DWORD indicating UINT32 struct byte stride
+// (3) a DWORD indicating the space index.
+//
+// ----------------------------------------------------------------------------
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
+#pragma endregion
diff --git a/thirdparty/directx_headers/d3d12.h b/thirdparty/directx_headers/include/directx/d3d12.h
index 07355f558c..d57513b7f8 100644
--- a/thirdparty/directx_headers/d3d12.h
+++ b/thirdparty/directx_headers/include/directx/d3d12.h
@@ -437,6 +437,20 @@ typedef interface ID3D12Device11 ID3D12Device11;
#endif /* __ID3D12Device11_FWD_DEFINED__ */
+#ifndef __ID3D12Device12_FWD_DEFINED__
+#define __ID3D12Device12_FWD_DEFINED__
+typedef interface ID3D12Device12 ID3D12Device12;
+
+#endif /* __ID3D12Device12_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device13_FWD_DEFINED__
+#define __ID3D12Device13_FWD_DEFINED__
+typedef interface ID3D12Device13 ID3D12Device13;
+
+#endif /* __ID3D12Device13_FWD_DEFINED__ */
+
+
#ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
#define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice;
@@ -507,6 +521,13 @@ typedef interface ID3D12GraphicsCommandList8 ID3D12GraphicsCommandList8;
#endif /* __ID3D12GraphicsCommandList8_FWD_DEFINED__ */
+#ifndef __ID3D12GraphicsCommandList9_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList9_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList9 ID3D12GraphicsCommandList9;
+
+#endif /* __ID3D12GraphicsCommandList9_FWD_DEFINED__ */
+
+
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
@@ -1039,7 +1060,7 @@ extern "C"{
#define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 )
-#define D3D12_PREVIEW_SDK_VERSION ( 706 )
+#define D3D12_PREVIEW_SDK_VERSION ( 712 )
#define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 )
@@ -1172,7 +1193,7 @@ extern "C"{
#define D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT ( 2 )
-#define D3D12_SDK_VERSION ( 606 )
+#define D3D12_SDK_VERSION ( 611 )
#define D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES ( 32 )
@@ -1290,6 +1311,16 @@ extern "C"{
#define D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN ( 0xffffffff )
+#define D3D12_VIDEO_ENCODER_AV1_INVALID_DPB_RESOURCE_INDEX ( 0xff )
+
+#define D3D12_VIDEO_ENCODER_AV1_MAX_TILE_COLS ( 64 )
+
+#define D3D12_VIDEO_ENCODER_AV1_MAX_TILE_ROWS ( 64 )
+
+#define D3D12_VIDEO_ENCODER_AV1_SUPERRES_DENOM_MIN ( 9 )
+
+#define D3D12_VIDEO_ENCODER_AV1_SUPERRES_NUM ( 8 )
+
#define D3D12_VIDEO_PROCESS_MAX_FILTERS ( 32 )
#define D3D12_VIDEO_PROCESS_STEREO_VIEWS ( 2 )
@@ -1642,6 +1673,44 @@ typedef struct D3D12_RASTERIZER_DESC
D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
} D3D12_RASTERIZER_DESC;
+typedef struct D3D12_RASTERIZER_DESC1
+ {
+ D3D12_FILL_MODE FillMode;
+ D3D12_CULL_MODE CullMode;
+ BOOL FrontCounterClockwise;
+ FLOAT DepthBias;
+ FLOAT DepthBiasClamp;
+ FLOAT SlopeScaledDepthBias;
+ BOOL DepthClipEnable;
+ BOOL MultisampleEnable;
+ BOOL AntialiasedLineEnable;
+ UINT ForcedSampleCount;
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
+ } D3D12_RASTERIZER_DESC1;
+
+typedef
+enum D3D12_LINE_RASTERIZATION_MODE
+ {
+ D3D12_LINE_RASTERIZATION_MODE_ALIASED = 0,
+ D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED = ( D3D12_LINE_RASTERIZATION_MODE_ALIASED + 1 ) ,
+ D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE = ( D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED + 1 ) ,
+ D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_NARROW = ( D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE + 1 )
+ } D3D12_LINE_RASTERIZATION_MODE;
+
+typedef struct D3D12_RASTERIZER_DESC2
+ {
+ D3D12_FILL_MODE FillMode;
+ D3D12_CULL_MODE CullMode;
+ BOOL FrontCounterClockwise;
+ FLOAT DepthBias;
+ FLOAT DepthBiasClamp;
+ FLOAT SlopeScaledDepthBias;
+ BOOL DepthClipEnable;
+ D3D12_LINE_RASTERIZATION_MODE LineRasterizationMode;
+ UINT ForcedSampleCount;
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
+ } D3D12_RASTERIZER_DESC2;
+
extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_c_ifspec;
@@ -2058,7 +2127,9 @@ typedef
enum D3D12_PIPELINE_STATE_FLAGS
{
D3D12_PIPELINE_STATE_FLAG_NONE = 0,
- D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1
+ D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1,
+ D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS = 0x4,
+ D3D12_PIPELINE_STATE_FLAG_DYNAMIC_INDEX_BUFFER_STRIP_CUT = 0x8
} D3D12_PIPELINE_STATE_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS );
@@ -2136,7 +2207,9 @@ enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS = 24,
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25,
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26,
- D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 + 1 )
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1 = 27,
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2 = 28,
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2 + 1 )
} D3D12_PIPELINE_STATE_SUBOBJECT_TYPE;
typedef
@@ -2176,7 +2249,15 @@ enum D3D12_FEATURE
D3D12_FEATURE_D3D12_OPTIONS12 = 41,
D3D12_FEATURE_D3D12_OPTIONS13 = 42,
D3D12_FEATURE_D3D12_OPTIONS14 = 43,
- D3D12_FEATURE_D3D12_OPTIONS15 = 44
+ D3D12_FEATURE_D3D12_OPTIONS15 = 44,
+ D3D12_FEATURE_D3D12_OPTIONS16 = 45,
+ D3D12_FEATURE_D3D12_OPTIONS17 = 46,
+ D3D12_FEATURE_D3D12_OPTIONS18 = 47,
+ D3D12_FEATURE_D3D12_OPTIONS19 = 48,
+ D3D12_FEATURE_D3D12_OPTIONS20 = 49,
+ D3D12_FEATURE_PREDICATION = 50,
+ D3D12_FEATURE_PLACED_RESOURCE_SUPPORT_INFO = 51,
+ D3D12_FEATURE_HARDWARE_COPY = 52
} D3D12_FEATURE;
typedef
@@ -2352,7 +2433,8 @@ enum D3D_ROOT_SIGNATURE_VERSION
{
D3D_ROOT_SIGNATURE_VERSION_1 = 0x1,
D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1,
- D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2
+ D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2,
+ D3D_ROOT_SIGNATURE_VERSION_1_2 = 0x3
} D3D_ROOT_SIGNATURE_VERSION;
typedef struct D3D12_FEATURE_DATA_ROOT_SIGNATURE
@@ -2668,6 +2750,60 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15
_Out_ BOOL DynamicIndexBufferStripCutSupported;
} D3D12_FEATURE_DATA_D3D12_OPTIONS15;
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS16
+ {
+ _Out_ BOOL DynamicDepthBiasSupported;
+ _Out_ BOOL GPUUploadHeapSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS16;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS17
+ {
+ _Out_ BOOL NonNormalizedCoordinateSamplersSupported;
+ _Out_ BOOL ManualWriteTrackingResourceSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS17;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS18
+ {
+ _Out_ BOOL RenderPassesValid;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS18;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS19
+ {
+ BOOL MismatchingOutputDimensionsSupported;
+ UINT SupportedSampleCountsWithNoOutputs;
+ BOOL PointSamplingAddressesNeverRoundUp;
+ BOOL RasterizerDesc2Supported;
+ BOOL NarrowQuadrilateralLinesSupported;
+ BOOL AnisoFilterWithPointMipSupported;
+ UINT MaxSamplerDescriptorHeapSize;
+ UINT MaxSamplerDescriptorHeapSizeWithStaticSamplers;
+ UINT MaxViewDescriptorHeapSize;
+ _Out_ BOOL ComputeOnlyCustomHeapSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS19;
+
+typedef
+enum D3D12_RECREATE_AT_TIER
+ {
+ D3D12_RECREATE_AT_TIER_NOT_SUPPORTED = 0,
+ D3D12_RECREATE_AT_TIER_1 = 1
+ } D3D12_RECREATE_AT_TIER;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS20
+ {
+ _Out_ BOOL ComputeOnlyWriteWatchSupported;
+ D3D12_RECREATE_AT_TIER RecreateAtTier;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS20;
+
+typedef struct D3D12_FEATURE_DATA_PREDICATION
+ {
+ _Out_ BOOL Supported;
+ } D3D12_FEATURE_DATA_PREDICATION;
+
+typedef struct D3D12_FEATURE_DATA_HARDWARE_COPY
+ {
+ _Out_ BOOL Supported;
+ } D3D12_FEATURE_DATA_HARDWARE_COPY;
+
typedef struct D3D12_RESOURCE_ALLOCATION_INFO
{
UINT64 SizeInBytes;
@@ -2687,7 +2823,8 @@ enum D3D12_HEAP_TYPE
D3D12_HEAP_TYPE_DEFAULT = 1,
D3D12_HEAP_TYPE_UPLOAD = 2,
D3D12_HEAP_TYPE_READBACK = 3,
- D3D12_HEAP_TYPE_CUSTOM = 4
+ D3D12_HEAP_TYPE_CUSTOM = 4,
+ D3D12_HEAP_TYPE_GPU_UPLOAD = 5
} D3D12_HEAP_TYPE;
typedef
@@ -2731,6 +2868,7 @@ enum D3D12_HEAP_FLAGS
D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400,
D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000,
+ D3D12_HEAP_FLAG_TOOLS_USE_MANUAL_WRITE_TRACKING = 0x2000,
D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0,
D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0,
D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44,
@@ -2756,6 +2894,14 @@ enum D3D12_RESOURCE_DIMENSION
D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4
} D3D12_RESOURCE_DIMENSION;
+typedef struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO
+ {
+ _In_ DXGI_FORMAT Format;
+ _In_ D3D12_RESOURCE_DIMENSION Dimension;
+ _In_ D3D12_HEAP_PROPERTIES DestHeapProperties;
+ _Out_ BOOL Supported;
+ } D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO;
+
typedef
enum D3D12_TEXTURE_LAYOUT
{
@@ -2945,6 +3091,11 @@ enum D3D12_RESOURCE_STATES
D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000,
D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000,
D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000,
+ D3D12_RESOURCE_STATE_RESERVED_INTERNAL_8000 = 0x8000,
+ D3D12_RESOURCE_STATE_RESERVED_INTERNAL_4000 = 0x4000,
+ D3D12_RESOURCE_STATE_RESERVED_INTERNAL_100000 = 0x100000,
+ D3D12_RESOURCE_STATE_RESERVED_INTERNAL_40000000 = 0x40000000,
+ D3D12_RESOURCE_STATE_RESERVED_INTERNAL_80000000 = 0x80000000,
D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) ,
D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) ,
D3D12_RESOURCE_STATE_PRESENT = 0,
@@ -3243,6 +3394,7 @@ enum D3D12_FILTER
D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+ D3D12_FILTER_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x54,
D3D12_FILTER_ANISOTROPIC = 0x55,
D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
@@ -3252,6 +3404,7 @@ enum D3D12_FILTER
D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
+ D3D12_FILTER_COMPARISON_MIN_MAG_ANISOTROPIC_MIP_POINT = 0xd4,
D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100,
D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101,
@@ -3261,6 +3414,7 @@ enum D3D12_FILTER
D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111,
D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114,
D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115,
+ D3D12_FILTER_MINIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x154,
D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155,
D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180,
D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181,
@@ -3270,6 +3424,7 @@ enum D3D12_FILTER
D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191,
D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194,
D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195,
+ D3D12_FILTER_MAXIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x1d4,
D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5
} D3D12_FILTER;
@@ -3316,6 +3471,13 @@ enum D3D12_FILTER_REDUCTION_TYPE
D3D12_FILTER_TYPE_LINEAR, \
D3D12_FILTER_TYPE_LINEAR, \
reduction ) ) )
+#define D3D12_ENCODE_MIN_MAG_ANISOTROPIC_MIP_POINT_FILTER( reduction ) \
+ ( ( D3D12_FILTER ) ( \
+ D3D12_ANISOTROPIC_FILTERING_BIT | \
+ D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \
+ D3D12_FILTER_TYPE_LINEAR, \
+ D3D12_FILTER_TYPE_POINT, \
+ reduction ) ) )
#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \
( ( D3D12_FILTER_TYPE ) \
( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
@@ -3333,8 +3495,7 @@ enum D3D12_FILTER_REDUCTION_TYPE
#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \
( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \
( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \
- ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \
- ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) )
+ ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) )
typedef
enum D3D12_TEXTURE_ADDRESS_MODE
{
@@ -3363,7 +3524,8 @@ typedef
enum D3D12_SAMPLER_FLAGS
{
D3D12_SAMPLER_FLAG_NONE = 0,
- D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1
+ D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1,
+ D3D12_SAMPLER_FLAG_NON_NORMALIZED_COORDINATES = 0x2
} D3D12_SAMPLER_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS );
@@ -3793,6 +3955,24 @@ typedef struct D3D12_STATIC_SAMPLER_DESC
D3D12_SHADER_VISIBILITY ShaderVisibility;
} D3D12_STATIC_SAMPLER_DESC;
+typedef struct D3D12_STATIC_SAMPLER_DESC1
+ {
+ D3D12_FILTER Filter;
+ D3D12_TEXTURE_ADDRESS_MODE AddressU;
+ D3D12_TEXTURE_ADDRESS_MODE AddressV;
+ D3D12_TEXTURE_ADDRESS_MODE AddressW;
+ FLOAT MipLODBias;
+ UINT MaxAnisotropy;
+ D3D12_COMPARISON_FUNC ComparisonFunc;
+ D3D12_STATIC_BORDER_COLOR BorderColor;
+ FLOAT MinLOD;
+ FLOAT MaxLOD;
+ UINT ShaderRegister;
+ UINT RegisterSpace;
+ D3D12_SHADER_VISIBILITY ShaderVisibility;
+ D3D12_SAMPLER_FLAGS Flags;
+ } D3D12_STATIC_SAMPLER_DESC1;
+
typedef struct D3D12_ROOT_SIGNATURE_DESC
{
UINT NumParameters;
@@ -3868,6 +4048,15 @@ typedef struct D3D12_ROOT_SIGNATURE_DESC1
D3D12_ROOT_SIGNATURE_FLAGS Flags;
} D3D12_ROOT_SIGNATURE_DESC1;
+typedef struct D3D12_ROOT_SIGNATURE_DESC2
+ {
+ UINT NumParameters;
+ _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER1 *pParameters;
+ UINT NumStaticSamplers;
+ _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC1 *pStaticSamplers;
+ D3D12_ROOT_SIGNATURE_FLAGS Flags;
+ } D3D12_ROOT_SIGNATURE_DESC2;
+
typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC
{
D3D_ROOT_SIGNATURE_VERSION Version;
@@ -3875,6 +4064,7 @@ typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC
{
D3D12_ROOT_SIGNATURE_DESC Desc_1_0;
D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1;
+ D3D12_ROOT_SIGNATURE_DESC2 Desc_1_2;
} ;
} D3D12_VERSIONED_ROOT_SIGNATURE_DESC;
@@ -13535,14 +13725,14 @@ typedef struct D3D12_DXIL_LIBRARY_DESC
{
D3D12_SHADER_BYTECODE DXILLibrary;
UINT NumExports;
- _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports;
+ _In_reads_(NumExports) const D3D12_EXPORT_DESC *pExports;
} D3D12_DXIL_LIBRARY_DESC;
typedef struct D3D12_EXISTING_COLLECTION_DESC
{
ID3D12StateObject *pExistingCollection;
UINT NumExports;
- _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports;
+ _In_reads_(NumExports) const D3D12_EXPORT_DESC *pExports;
} D3D12_EXISTING_COLLECTION_DESC;
typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION
@@ -14760,7 +14950,9 @@ enum D3D12_AUTO_BREADCRUMB_OP
D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41,
D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42,
D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43,
- D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44
+ D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44,
+ D3D12_AUTO_BREADCRUMB_OP_BARRIER = 45,
+ D3D12_AUTO_BREADCRUMB_OP_BEGIN_COMMAND_LIST = 46
} D3D12_AUTO_BREADCRUMB_OP;
typedef struct D3D12_AUTO_BREADCRUMB_NODE
@@ -19808,7 +20000,10 @@ enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD = 0,
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD + 1 ) ,
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE + 1 ) ,
- D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 )
+ D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 ) ,
+ D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS + 1 ) ,
+ D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER + 1 ) ,
+ D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_UAV = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV + 1 )
} D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE;
typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS
@@ -19816,12 +20011,19 @@ typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS
D3D12_CLEAR_VALUE ClearValue;
} D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS;
+typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS
+ {
+ UINT AdditionalWidth;
+ UINT AdditionalHeight;
+ } D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS;
+
typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS
{
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type;
union
{
D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear;
+ D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal;
} ;
} D3D12_RENDER_PASS_BEGINNING_ACCESS;
@@ -19831,7 +20033,10 @@ enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD = 0,
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD + 1 ) ,
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE + 1 ) ,
- D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 )
+ D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 ) ,
+ D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS + 1 ) ,
+ D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER + 1 ) ,
+ D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_UAV = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV + 1 )
} D3D12_RENDER_PASS_ENDING_ACCESS_TYPE;
typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS
@@ -19854,12 +20059,19 @@ typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS
BOOL PreserveResolveSource;
} D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS;
+typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS
+ {
+ UINT AdditionalWidth;
+ UINT AdditionalHeight;
+ } D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS;
+
typedef struct D3D12_RENDER_PASS_ENDING_ACCESS
{
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type;
union
{
D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve;
+ D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal;
} ;
} D3D12_RENDER_PASS_ENDING_ACCESS;
@@ -19885,7 +20097,9 @@ enum D3D12_RENDER_PASS_FLAGS
D3D12_RENDER_PASS_FLAG_NONE = 0,
D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1,
D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2,
- D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4
+ D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4,
+ D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_DEPTH = 0x8,
+ D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_STENCIL = 0x10
} D3D12_RENDER_PASS_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS );
@@ -20968,7 +21182,7 @@ enum D3D12_BARRIER_SYNC
D3D12_BARRIER_SYNC_NONE = 0,
D3D12_BARRIER_SYNC_ALL = 0x1,
D3D12_BARRIER_SYNC_DRAW = 0x2,
- D3D12_BARRIER_SYNC_INPUT_ASSEMBLER = 0x4,
+ D3D12_BARRIER_SYNC_INDEX_INPUT = 0x4,
D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8,
D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10,
D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20,
@@ -22299,7 +22513,7 @@ EXTERN_C const IID IID_ID3D12Device10;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource) = 0;
@@ -22310,7 +22524,7 @@ EXTERN_C const IID IID_ID3D12Device10;
D3D12_BARRIER_LAYOUT InitialLayout,
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource) = 0;
@@ -22320,7 +22534,7 @@ EXTERN_C const IID IID_ID3D12Device10;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource) = 0;
@@ -22968,7 +23182,7 @@ EXTERN_C const IID IID_ID3D12Device10;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
@@ -22981,7 +23195,7 @@ EXTERN_C const IID IID_ID3D12Device10;
D3D12_BARRIER_LAYOUT InitialLayout,
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
@@ -22993,7 +23207,7 @@ EXTERN_C const IID IID_ID3D12Device10;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
@@ -23958,7 +24172,7 @@ EXTERN_C const IID IID_ID3D12Device11;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
@@ -23971,7 +24185,7 @@ EXTERN_C const IID IID_ID3D12Device11;
D3D12_BARRIER_LAYOUT InitialLayout,
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
@@ -23983,7 +24197,7 @@ EXTERN_C const IID IID_ID3D12Device11;
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
UINT32 NumCastableFormats,
- _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
@@ -24295,6 +24509,2101 @@ EXTERN_C const IID IID_ID3D12Device11;
#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */
+#ifndef __ID3D12Device12_INTERFACE_DEFINED__
+#define __ID3D12Device12_INTERFACE_DEFINED__
+
+/* interface ID3D12Device12 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device12;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5af5c532-4c91-4cd0-b541-15a405395fc5")
+ ID3D12Device12 : public ID3D12Device11
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo3(
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#else
+ virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo3(
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device12Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device12 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device12 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device12 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device12 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device12 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device12 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device12 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device12 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device12 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device12 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device12 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device12 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device12 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device12 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device12 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device12 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device12 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device12 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device12 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device12 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device12 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device12 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device12 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device12 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device12 * 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,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device12 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device12 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device12 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device12 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device12 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device12 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device12 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device12 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device12 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device12 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device12 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device12 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device12 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device12 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device12 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device12 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device12 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device12 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device12 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device12 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device12 * 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_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device12 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device12 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device12 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device12 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device12 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device12 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device12 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device12 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device12 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device12 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device12 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device12 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device12 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device12 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device12 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl)
+ HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )(
+ ID3D12Device12 * This,
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )(
+ ID3D12Device12 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2)
+ void ( STDMETHODCALLTYPE *CreateSampler2 )(
+ ID3D12Device12 * This,
+ _In_ const D3D12_SAMPLER_DESC2 *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device12, GetResourceAllocationInfo3)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )(
+ ID3D12Device12 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )(
+ ID3D12Device12 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12Device12Vtbl;
+
+ interface ID3D12Device12
+ {
+ CONST_VTBL struct ID3D12Device12Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device12_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device12_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device12_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device12_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device12_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device12_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device12_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device12_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device12_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device12_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device12_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device12_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device12_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device12_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device12_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device12_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device12_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device12_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device12_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device12_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device12_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device12_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device12_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device12_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device12_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device12_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device12_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device12_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device12_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device12_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device12_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device12_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device12_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device12_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device12_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device12_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device12_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device12_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device12_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device12_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device12_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device12_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device12_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device12_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device12_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device12_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device12_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device12_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device12_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device12_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device12_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device12_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device12_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device12_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device12_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device12_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device12_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device12_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device12_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device12_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device12_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device12_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device12_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device12_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device12_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device12_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device12_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device12_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+
+#define ID3D12Device12_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \
+ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) )
+
+#define ID3D12Device12_ShaderCacheControl(This,Kinds,Control) \
+ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) )
+
+#define ID3D12Device12_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) )
+
+
+#define ID3D12Device12_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) )
+
+#define ID3D12Device12_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+#define ID3D12Device12_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+
+#define ID3D12Device12_CreateSampler2(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device12_GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device12_GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device12_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device13_INTERFACE_DEFINED__
+#define __ID3D12Device13_INTERFACE_DEFINED__
+
+/* interface ID3D12Device13 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device13;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("14eecffc-4df8-40f7-a118-5c816f45695e")
+ ID3D12Device13 : public ID3D12Device12
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromAddress1(
+ _In_ const void *pAddress,
+ SIZE_T size,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device13Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device13 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device13 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device13 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device13 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device13 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device13 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device13 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device13 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device13 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device13 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device13 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device13 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device13 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device13 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device13 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device13 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device13 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device13 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device13 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device13 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device13 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device13 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device13 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device13 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device13 * 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,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device13 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device13 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device13 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device13 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device13 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device13 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device13 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device13 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device13 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device13 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device13 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device13 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device13 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device13 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device13 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device13 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device13 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device13 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device13 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device13 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device13 * 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_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device13 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device13 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device13 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device13 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device13 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device13 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device13 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device13 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device13 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device13 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device13 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device13 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device13 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device13 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device13 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl)
+ HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )(
+ ID3D12Device13 * This,
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )(
+ ID3D12Device13 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2)
+ void ( STDMETHODCALLTYPE *CreateSampler2 )(
+ ID3D12Device13 * This,
+ _In_ const D3D12_SAMPLER_DESC2 *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device12, GetResourceAllocationInfo3)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )(
+ ID3D12Device13 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )(
+ ID3D12Device13 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats,
+ _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device13, OpenExistingHeapFromAddress1)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress1 )(
+ ID3D12Device13 * This,
+ _In_ const void *pAddress,
+ SIZE_T size,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ END_INTERFACE
+ } ID3D12Device13Vtbl;
+
+ interface ID3D12Device13
+ {
+ CONST_VTBL struct ID3D12Device13Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device13_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device13_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device13_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device13_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device13_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device13_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device13_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device13_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device13_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device13_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device13_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device13_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device13_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device13_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device13_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device13_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device13_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device13_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device13_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device13_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device13_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device13_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device13_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device13_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device13_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device13_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device13_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device13_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device13_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device13_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device13_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device13_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device13_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device13_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device13_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device13_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device13_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device13_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device13_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device13_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device13_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device13_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device13_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device13_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device13_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device13_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device13_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device13_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device13_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device13_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device13_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device13_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device13_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device13_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device13_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device13_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device13_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device13_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device13_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device13_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device13_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device13_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device13_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device13_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device13_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device13_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device13_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device13_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+
+#define ID3D12Device13_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \
+ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) )
+
+#define ID3D12Device13_ShaderCacheControl(This,Kinds,Control) \
+ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) )
+
+#define ID3D12Device13_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) )
+
+
+#define ID3D12Device13_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) )
+
+#define ID3D12Device13_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+#define ID3D12Device13_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+
+#define ID3D12Device13_CreateSampler2(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device13_GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device13_GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device13_OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device13_INTERFACE_DEFINED__ */
+
+
#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__
#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__
@@ -24487,7 +26796,7 @@ EXTERN_C const IID IID_ID3D12Tools;
#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0057 */
+/* interface __MIDL_itf_d3d12_0000_0059 */
/* [local] */
typedef struct D3D12_SUBRESOURCE_DATA
@@ -24622,8 +26931,8 @@ HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_O
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec;
#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__
#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__
@@ -24818,7 +27127,7 @@ EXTERN_C const IID IID_ID3D12SDKConfiguration1;
#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0059 */
+/* interface __MIDL_itf_d3d12_0000_0061 */
/* [local] */
typedef
@@ -24833,8 +27142,8 @@ enum D3D12_DEVICE_FACTORY_FLAGS
DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS );
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec;
#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__
#define __ID3D12DeviceFactory_INTERFACE_DEFINED__
@@ -24995,7 +27304,7 @@ EXTERN_C const IID IID_ID3D12DeviceFactory;
#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0060 */
+/* interface __MIDL_itf_d3d12_0000_0062 */
/* [local] */
typedef
@@ -25026,8 +27335,8 @@ typedef struct D3D12_DEVICE_CONFIGURATION_DESC
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec;
#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__
#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__
@@ -25173,7 +27482,7 @@ EXTERN_C const IID IID_ID3D12DeviceConfiguration;
#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0061 */
+/* interface __MIDL_itf_d3d12_0000_0063 */
/* [local] */
typedef
@@ -25213,8 +27522,8 @@ enum D3D12_SHADING_RATE_COMBINER
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0063_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0063_v0_0_s_ifspec;
#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__
#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__
@@ -26049,7 +28358,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0062 */
+/* interface __MIDL_itf_d3d12_0000_0064 */
/* [local] */
typedef struct D3D12_DISPATCH_MESH_ARGUMENTS
@@ -26061,8 +28370,8 @@ typedef struct D3D12_DISPATCH_MESH_ARGUMENTS
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0064_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0064_v0_0_s_ifspec;
#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__
#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__
@@ -28618,7 +30927,891 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8;
#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0065 */
+#ifndef __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__
+#define __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__
+
+/* interface ID3D12GraphicsCommandList9 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12GraphicsCommandList9;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("34ed2808-ffe6-4c2b-b11a-cabd2b0c59e1")
+ ID3D12GraphicsCommandList9 : public ID3D12GraphicsCommandList8
+ {
+ public:
+ virtual void STDMETHODCALLTYPE RSSetDepthBias(
+ _In_ FLOAT DepthBias,
+ _In_ FLOAT DepthBiasClamp,
+ _In_ FLOAT SlopeScaledDepthBias) = 0;
+
+ virtual void STDMETHODCALLTYPE IASetIndexBufferStripCutValue(
+ _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12GraphicsCommandList9Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12GraphicsCommandList9 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12GraphicsCommandList9 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
+ void ( STDMETHODCALLTYPE *CopyBufferRegion )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
+ void ( STDMETHODCALLTYPE *CopyTextureRegion )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
+ void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetStencilRef )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT StencilRef);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
+ void ( STDMETHODCALLTYPE *SetPipelineState )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
+ void ( STDMETHODCALLTYPE *ExecuteBundle )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12GraphicsCommandList *pCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
+ void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
+ void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12GraphicsCommandList9 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12GraphicsCommandList9 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
+ void ( STDMETHODCALLTYPE *ExecuteIndirect )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
+ void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ FLOAT Min,
+ _In_ FLOAT Max);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
+ void ( STDMETHODCALLTYPE *SetSamplePositions )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT NumSamplesPerPixel,
+ _In_ UINT NumPixels,
+ _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
+ void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ UINT DstX,
+ _In_ UINT DstY,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_opt_ D3D12_RECT *pSrcRect,
+ _In_ DXGI_FORMAT Format,
+ _In_ D3D12_RESOLVE_MODE ResolveMode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
+ void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12GraphicsCommandList9 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
+ void ( STDMETHODCALLTYPE *BeginRenderPass )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT NumRenderTargets,
+ _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets,
+ _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
+ D3D12_RENDER_PASS_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
+ void ( STDMETHODCALLTYPE *EndRenderPass )(
+ ID3D12GraphicsCommandList9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
+ void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
+ _In_ SIZE_T InitializationParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
+ void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
+ _In_ SIZE_T ExecutionParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
+ _In_ UINT NumPostbuildInfoDescs,
+ _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
+ void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
+ _In_ UINT NumSourceAccelerationStructures,
+ _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
+ _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
+ void ( STDMETHODCALLTYPE *SetPipelineState1 )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ ID3D12StateObject *pStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
+ void ( STDMETHODCALLTYPE *DispatchRays )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate)
+ void ( STDMETHODCALLTYPE *RSSetShadingRate )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_SHADING_RATE baseShadingRate,
+ _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage)
+ void ( STDMETHODCALLTYPE *RSSetShadingRateImage )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_opt_ ID3D12Resource *shadingRateImage);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh)
+ void ( STDMETHODCALLTYPE *DispatchMesh )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12GraphicsCommandList9 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ UINT FrontStencilRef,
+ _In_ UINT BackStencilRef);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, RSSetDepthBias)
+ void ( STDMETHODCALLTYPE *RSSetDepthBias )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ FLOAT DepthBias,
+ _In_ FLOAT DepthBiasClamp,
+ _In_ FLOAT SlopeScaledDepthBias);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, IASetIndexBufferStripCutValue)
+ void ( STDMETHODCALLTYPE *IASetIndexBufferStripCutValue )(
+ ID3D12GraphicsCommandList9 * This,
+ _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue);
+
+ END_INTERFACE
+ } ID3D12GraphicsCommandList9Vtbl;
+
+ interface ID3D12GraphicsCommandList9
+ {
+ CONST_VTBL struct ID3D12GraphicsCommandList9Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12GraphicsCommandList9_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12GraphicsCommandList9_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12GraphicsCommandList9_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12GraphicsCommandList9_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12GraphicsCommandList9_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12GraphicsCommandList9_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12GraphicsCommandList9_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12GraphicsCommandList9_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12GraphicsCommandList9_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12GraphicsCommandList9_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12GraphicsCommandList9_Reset(This,pAllocator,pInitialState) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) )
+
+#define ID3D12GraphicsCommandList9_ClearState(This,pPipelineState) \
+ ( (This)->lpVtbl -> ClearState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList9_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList9_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList9_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D12GraphicsCommandList9_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \
+ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) )
+
+#define ID3D12GraphicsCommandList9_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \
+ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) )
+
+#define ID3D12GraphicsCommandList9_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D12GraphicsCommandList9_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D12GraphicsCommandList9_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D12GraphicsCommandList9_IASetPrimitiveTopology(This,PrimitiveTopology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) )
+
+#define ID3D12GraphicsCommandList9_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D12GraphicsCommandList9_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList9_OMSetBlendFactor(This,BlendFactor) \
+ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) )
+
+#define ID3D12GraphicsCommandList9_OMSetStencilRef(This,StencilRef) \
+ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) )
+
+#define ID3D12GraphicsCommandList9_SetPipelineState(This,pPipelineState) \
+ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList9_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12GraphicsCommandList9_ExecuteBundle(This,pCommandList) \
+ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) )
+
+#define ID3D12GraphicsCommandList9_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \
+ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList9_IASetIndexBuffer(This,pView) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) )
+
+#define ID3D12GraphicsCommandList9_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList9_SOSetTargets(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList9_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) )
+
+#define ID3D12GraphicsCommandList9_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList9_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList9_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12GraphicsCommandList9_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList9_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList9_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12GraphicsCommandList9_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12GraphicsCommandList9_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList9_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList9_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12GraphicsCommandList9_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \
+ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) )
+
+
+#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList9_OMSetDepthBounds(This,Min,Max) \
+ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) )
+
+#define ID3D12GraphicsCommandList9_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \
+ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) )
+
+#define ID3D12GraphicsCommandList9_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \
+ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) )
+
+#define ID3D12GraphicsCommandList9_SetViewInstanceMask(This,Mask) \
+ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) )
+
+
+#define ID3D12GraphicsCommandList9_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12GraphicsCommandList9_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12GraphicsCommandList9_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \
+ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) )
+
+#define ID3D12GraphicsCommandList9_EndRenderPass(This) \
+ ( (This)->lpVtbl -> EndRenderPass(This) )
+
+#define ID3D12GraphicsCommandList9_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList9_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList9_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \
+ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) )
+
+#define ID3D12GraphicsCommandList9_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \
+ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) )
+
+#define ID3D12GraphicsCommandList9_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \
+ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) )
+
+#define ID3D12GraphicsCommandList9_SetPipelineState1(This,pStateObject) \
+ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) )
+
+#define ID3D12GraphicsCommandList9_DispatchRays(This,pDesc) \
+ ( (This)->lpVtbl -> DispatchRays(This,pDesc) )
+
+
+#define ID3D12GraphicsCommandList9_RSSetShadingRate(This,baseShadingRate,combiners) \
+ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) )
+
+#define ID3D12GraphicsCommandList9_RSSetShadingRateImage(This,shadingRateImage) \
+ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) )
+
+
+#define ID3D12GraphicsCommandList9_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+
+#define ID3D12GraphicsCommandList9_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+
+#define ID3D12GraphicsCommandList9_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \
+ ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) )
+
+
+#define ID3D12GraphicsCommandList9_RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) \
+ ( (This)->lpVtbl -> RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) )
+
+#define ID3D12GraphicsCommandList9_IASetIndexBufferStripCutValue(This,IBStripCutValue) \
+ ( (This)->lpVtbl -> IASetIndexBufferStripCutValue(This,IBStripCutValue) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0068 */
/* [local] */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
@@ -28678,6 +31871,8 @@ DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12
DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c);
DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31);
DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39);
+DEFINE_GUID(IID_ID3D12Device12,0x5af5c532,0x4c91,0x4cd0,0xb5,0x41,0x15,0xa4,0x05,0x39,0x5f,0xc5);
+DEFINE_GUID(IID_ID3D12Device13,0x14eecffc,0x4df8,0x40f7,0xa1,0x18,0x5c,0x81,0x6f,0x45,0x69,0x5e);
DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76);
DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5);
DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7);
@@ -28688,10 +31883,11 @@ DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x
DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80);
DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1);
DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51);
+DEFINE_GUID(IID_ID3D12GraphicsCommandList9,0x34ed2808,0xffe6,0x4c2b,0xb1,0x1a,0xca,0xbd,0x2b,0x0c,0x59,0xe1);
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0068_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0068_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
diff --git a/thirdparty/directx_headers/d3d12compatibility.h b/thirdparty/directx_headers/include/directx/d3d12compatibility.h
index 1a9430e5c9..1a9430e5c9 100644
--- a/thirdparty/directx_headers/d3d12compatibility.h
+++ b/thirdparty/directx_headers/include/directx/d3d12compatibility.h
diff --git a/thirdparty/directx_headers/d3d12sdklayers.h b/thirdparty/directx_headers/include/directx/d3d12sdklayers.h
index b25a8f6e5d..06aa091b55 100644
--- a/thirdparty/directx_headers/d3d12sdklayers.h
+++ b/thirdparty/directx_headers/include/directx/d3d12sdklayers.h
@@ -171,6 +171,13 @@ typedef interface ID3D12SharingContract ID3D12SharingContract;
#endif /* __ID3D12SharingContract_FWD_DEFINED__ */
+#ifndef __ID3D12ManualWriteTrackingResource_FWD_DEFINED__
+#define __ID3D12ManualWriteTrackingResource_FWD_DEFINED__
+typedef interface ID3D12ManualWriteTrackingResource ID3D12ManualWriteTrackingResource;
+
+#endif /* __ID3D12ManualWriteTrackingResource_FWD_DEFINED__ */
+
+
#ifndef __ID3D12InfoQueue_FWD_DEFINED__
#define __ID3D12InfoQueue_FWD_DEFINED__
typedef interface ID3D12InfoQueue ID3D12InfoQueue;
@@ -2237,7 +2244,92 @@ EXTERN_C const IID IID_ID3D12SharingContract;
#endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12sdklayers_0000_0017 */
+#ifndef __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__
+#define __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__
+
+/* interface ID3D12ManualWriteTrackingResource */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12ManualWriteTrackingResource;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("86ca3b85-49ad-4b6e-aed5-eddb18540f41")
+ ID3D12ManualWriteTrackingResource : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE TrackWrite(
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pWrittenRange) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12ManualWriteTrackingResourceVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12ManualWriteTrackingResource * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12ManualWriteTrackingResource * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12ManualWriteTrackingResource * This);
+
+ DECLSPEC_XFGVIRT(ID3D12ManualWriteTrackingResource, TrackWrite)
+ void ( STDMETHODCALLTYPE *TrackWrite )(
+ ID3D12ManualWriteTrackingResource * This,
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pWrittenRange);
+
+ END_INTERFACE
+ } ID3D12ManualWriteTrackingResourceVtbl;
+
+ interface ID3D12ManualWriteTrackingResource
+ {
+ CONST_VTBL struct ID3D12ManualWriteTrackingResourceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12ManualWriteTrackingResource_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12ManualWriteTrackingResource_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12ManualWriteTrackingResource_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12ManualWriteTrackingResource_TrackWrite(This,Subresource,pWrittenRange) \
+ ( (This)->lpVtbl -> TrackWrite(This,Subresource,pWrittenRange) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */
/* [local] */
typedef
@@ -2375,6 +2467,9 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115,
D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116,
D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117,
+ D3D12_MESSAGE_ID_GET_PROGRAM_IDENTIFIER_ERROR = 118,
+ D3D12_MESSAGE_ID_GET_WORK_GRAPH_PROPERTIES_ERROR = 119,
+ D3D12_MESSAGE_ID_SET_PROGRAM_ERROR = 120,
D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135,
D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200,
D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201,
@@ -3176,8 +3271,6 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341,
D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342,
D3D12_MESSAGE_ID_ENHANCED_BARRIERS_NOT_SUPPORTED = 1343,
- D3D12_MESSAGE_ID_CAST_TARGET_TEXEL_SIZE_MISMATCH = 1344,
- D3D12_MESSAGE_ID_CAST_TO_PLANAR_NOT_SUPORTED = 1345,
D3D12_MESSAGE_ID_LEGACY_BARRIER_VALIDATION_FORCED_ON = 1346,
D3D12_MESSAGE_ID_EMPTY_ROOT_DESCRIPTOR_TABLE = 1347,
D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ELEMENT_OFFSET_UNALIGNED = 1348,
@@ -3191,10 +3284,35 @@ enum D3D12_MESSAGE_ID
D3D12_MESSAGE_ID_NON_OPTIMAL_BARRIER_ONLY_EXECUTE_COMMAND_LISTS = 1356,
D3D12_MESSAGE_ID_EXECUTE_INDIRECT_ZERO_COMMAND_COUNT = 1357,
D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_TEXTURE_LAYOUT = 1358,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359,
+ D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359,
D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_TRIANGLE_FANS_NOT_SUPPORTED = 1360,
D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED = 1361,
- D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED + 1 )
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDHEAPTYPE = 1362,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPTYPE = 1363,
+ D3D12_MESSAGE_ID_DYNAMIC_DEPTH_BIAS_NOT_SUPPORTED = 1364,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NON_WHOLE_DYNAMIC_DEPTH_BIAS = 1365,
+ D3D12_MESSAGE_ID_DYNAMIC_DEPTH_BIAS_FLAG_MISSING = 1366,
+ D3D12_MESSAGE_ID_DYNAMIC_DEPTH_BIAS_NO_PIPELINE = 1367,
+ D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_FLAG_MISSING = 1368,
+ D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NO_PIPELINE = 1369,
+ D3D12_MESSAGE_ID_NONNORMALIZED_COORDINATE_SAMPLING_NOT_SUPPORTED = 1370,
+ D3D12_MESSAGE_ID_INVALID_CAST_TARGET = 1371,
+ D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_END_STATE = 1372,
+ D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_START_STATE = 1373,
+ D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_ACCESS = 1374,
+ D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_LOCAL_PRESERVE_PARAMETERS = 1375,
+ D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_PRESERVE_RENDER_PARAMETERS_ERROR = 1376,
+ D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_DEPTH_STENCIL_ERROR = 1377,
+ D3D12_MESSAGE_ID_DRAW_POTENTIALLY_OUTSIDE_OF_VALID_RENDER_AREA = 1378,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_LINERASTERIZATIONMODE = 1379,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT_SMALLRESOURCE = 1380,
+ D3D12_MESSAGE_ID_GENERIC_DEVICE_OPERATION_UNSUPPORTED = 1381,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDER_TARGET_WRONG_WRITE_MASK = 1382,
+ D3D12_MESSAGE_ID_PROBABLE_PIX_EVENT_LEAK = 1383,
+ D3D12_MESSAGE_ID_PIX_EVENT_UNDERFLOW = 1384,
+ D3D12_MESSAGE_ID_RECREATEAT_INVALID_TARGET = 1385,
+ D3D12_MESSAGE_ID_RECREATEAT_INSUFFICIENT_SUPPORT = 1386,
+ D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_RECREATEAT_INSUFFICIENT_SUPPORT + 1 )
} D3D12_MESSAGE_ID;
typedef struct D3D12_MESSAGE
@@ -3225,8 +3343,8 @@ typedef struct D3D12_INFO_QUEUE_FILTER
#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec;
#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__
#define __ID3D12InfoQueue_INTERFACE_DEFINED__
@@ -3671,7 +3789,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue;
#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */
+/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */
/* [local] */
typedef
@@ -3691,8 +3809,8 @@ typedef void ( __stdcall *D3D12MessageFunc )(
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec;
#ifndef __ID3D12InfoQueue1_INTERFACE_DEFINED__
#define __ID3D12InfoQueue1_INTERFACE_DEFINED__
@@ -3712,7 +3830,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1;
virtual HRESULT STDMETHODCALLTYPE RegisterMessageCallback(
_In_ D3D12MessageFunc CallbackFunc,
_In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags,
- _In_ void *pContext,
+ _Inout_ void *pContext,
_Inout_ DWORD *pCallbackCookie) = 0;
virtual HRESULT STDMETHODCALLTYPE UnregisterMessageCallback(
@@ -3914,7 +4032,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1;
ID3D12InfoQueue1 * This,
_In_ D3D12MessageFunc CallbackFunc,
_In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags,
- _In_ void *pContext,
+ _Inout_ void *pContext,
_Inout_ DWORD *pCallbackCookie);
DECLSPEC_XFGVIRT(ID3D12InfoQueue1, UnregisterMessageCallback)
@@ -4068,7 +4186,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1;
#endif /* __ID3D12InfoQueue1_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */
+/* interface __MIDL_itf_d3d12sdklayers_0000_0020 */
/* [local] */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
@@ -4090,12 +4208,13 @@ DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0
DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e);
DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f);
DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef);
+DEFINE_GUID(IID_ID3D12ManualWriteTrackingResource,0x86ca3b85,0x49ad,0x4b6e,0xae,0xd5,0xed,0xdb,0x18,0x54,0x0f,0x41);
DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);
DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00);
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0020_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0020_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
diff --git a/thirdparty/directx_headers/d3d12shader.h b/thirdparty/directx_headers/include/directx/d3d12shader.h
index 0acf584e32..0acf584e32 100644
--- a/thirdparty/directx_headers/d3d12shader.h
+++ b/thirdparty/directx_headers/include/directx/d3d12shader.h
diff --git a/thirdparty/directx_headers/d3d12video.h b/thirdparty/directx_headers/include/directx/d3d12video.h
index add372e381..fe9a17377c 100644
--- a/thirdparty/directx_headers/d3d12video.h
+++ b/thirdparty/directx_headers/include/directx/d3d12video.h
@@ -338,7 +338,9 @@ enum D3D12_FEATURE_VIDEO
D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42,
D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43,
D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44,
- D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45
+ D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45,
+ D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG = 46,
+ D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1 = 47
} D3D12_FEATURE_VIDEO;
typedef
@@ -6311,6 +6313,16 @@ DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME, 0x0685b993, 0x3d8c, 0x43a0, 0x8b, 0x28, 0xd7, 0x4c, 0x2d, 0x68, 0x99, 0xa4);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME10, 0x142a1d0f, 0x69dd, 0x4ec9, 0x85, 0x91, 0xb1, 0x2f, 0xfc, 0xb9, 0x1a, 0x29);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12, 0x1a72925f, 0x0c2c, 0x4f15, 0x96, 0xfb, 0xb1, 0x7d, 0x14, 0x73, 0x60, 0x3f);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_422, 0x0bac4fe5, 0x1532, 0x4429, 0xa8, 0x54, 0xf8, 0x4d, 0xe0, 0x49, 0x53, 0xdb);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_422, 0x55bcac81, 0xf311, 0x4093, 0xa7, 0xd0, 0x1c, 0xbc, 0x0b, 0x84, 0x9b, 0xee);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN_444, 0x4008018f, 0xf537, 0x4b36, 0x98, 0xcf, 0x61, 0xaf, 0x8a, 0x2c, 0x1a, 0x33);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_EXT, 0x9cc55490, 0xe37c, 0x4932, 0x86, 0x84, 0x49, 0x20, 0xf9, 0xf6, 0x40, 0x9c);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_444, 0x0dabeffa, 0x4458, 0x4602, 0xbc, 0x03, 0x07, 0x95, 0x65, 0x9d, 0x61, 0x7c);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_444, 0x9798634d, 0xfe9d, 0x48e5, 0xb4, 0xda, 0xdb, 0xec, 0x45, 0xb3, 0xdf, 0x01);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN16, 0xa4fbdbb0, 0xa113, 0x482b, 0xa2, 0x32, 0x63, 0x5c, 0xc0, 0x69, 0x7f, 0x6d);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);
@@ -6320,6 +6332,463 @@ DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089,
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);
DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);
typedef
+enum D3D12_VIDEO_ENCODER_AV1_PROFILE
+ {
+ D3D12_VIDEO_ENCODER_AV1_PROFILE_MAIN = 0,
+ D3D12_VIDEO_ENCODER_AV1_PROFILE_HIGH = 1,
+ D3D12_VIDEO_ENCODER_AV1_PROFILE_PROFESSIONAL = 2
+ } D3D12_VIDEO_ENCODER_AV1_PROFILE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_LEVELS
+ {
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_2_0 = 0,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_2_1 = 1,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_2_2 = 2,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_2_3 = 3,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_3_0 = 4,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_3_1 = 5,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_3_2 = 6,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_3_3 = 7,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_4_0 = 8,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_4_1 = 9,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_4_2 = 10,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_4_3 = 11,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_5_0 = 12,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_5_1 = 13,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_5_2 = 14,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_5_3 = 15,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_6_0 = 16,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_6_1 = 17,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_6_2 = 18,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_6_3 = 19,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_7_0 = 20,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_7_1 = 21,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_7_2 = 22,
+ D3D12_VIDEO_ENCODER_AV1_LEVELS_7_3 = 23
+ } D3D12_VIDEO_ENCODER_AV1_LEVELS;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_TIER
+ {
+ D3D12_VIDEO_ENCODER_AV1_TIER_MAIN = 0,
+ D3D12_VIDEO_ENCODER_AV1_TIER_HIGH = 1
+ } D3D12_VIDEO_ENCODER_AV1_TIER;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS
+ {
+ D3D12_VIDEO_ENCODER_AV1_LEVELS Level;
+ D3D12_VIDEO_ENCODER_AV1_TIER Tier;
+ } D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_128x128_SUPERBLOCK = 0x1,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FILTER_INTRA = 0x2,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_EDGE_FILTER = 0x4,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTERINTRA_COMPOUND = 0x8,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MASKED_COMPOUND = 0x10,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_WARPED_MOTION = 0x20,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DUAL_FILTER = 0x40,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_JNT_COMP = 0x80,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FORCED_INTEGER_MOTION_VECTORS = 0x100,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SUPER_RESOLUTION = 0x200,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_RESTORATION_FILTER = 0x400,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_PALETTE_ENCODING = 0x800,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CDEF_FILTERING = 0x1000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_BLOCK_COPY = 0x2000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x4000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ORDER_HINT_TOOLS = 0x8000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_AUTO_SEGMENTATION = 0x10000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CUSTOM_SEGMENTATION = 0x20000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_FILTER_DELTAS = 0x40000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_DELTAS = 0x80000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_MATRIX = 0x100000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_REDUCED_TX_SET = 0x200000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MOTION_MODE_SWITCHABLE = 0x400000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ALLOW_HIGH_PRECISION_MV = 0x800000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SKIP_MODE_PRESENT = 0x1000000,
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DELTA_LF_PARAMS = 0x2000000
+ } D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_TX_MODE
+ {
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4 = 0,
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST = 1,
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT = 2
+ } D3D12_VIDEO_ENCODER_AV1_TX_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_ONLY4x4 = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4 ) ,
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_LARGEST = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST ) ,
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_SELECT = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT )
+ } D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS
+ {
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP = 0,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH = 1,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP = 2,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR = 3,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE = 4
+ } D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP ) ,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SMOOTH = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH ) ,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SHARP = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP ) ,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_BILINEAR = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR ) ,
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_SWITCHABLE = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE )
+ } D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE
+ {
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_4x4 = 0,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_8x8 = 1,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_16x16 = 2,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_32x32 = 3,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_64x64 = 4
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE
+ {
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED = 0,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q = 1,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V = 2,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H = 3,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U = 4,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V = 5,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME = 6,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP = 7,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV = 8
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_DISABLED = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_Q = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_V = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_H = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_U = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_V = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_REF_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_SKIP = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP ) ,
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_GLOBALMV = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV )
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE
+ {
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_DISABLED = 0,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SWITCHABLE = 1,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_WIENER = 2,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SGRPROJ = 3
+ } D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE
+ {
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_DISABLED = 0,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_32x32 = 1,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_64x64 = 2,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_128x128 = 3,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_256x256 = 4
+ } D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_NOT_SUPPORTED = 0,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_32x32 = 0x1,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_64x64 = 0x2,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_128x128 = 0x4,
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_256x256 = 0x8
+ } D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION
+ {
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY = 0,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION = 1,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM = 2,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE = 3
+ } D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_IDENTITY = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY ) ,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_TRANSLATION = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION ) ,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_ROTZOOM = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM ) ,
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_AFFINE = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE )
+ } D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION = 0x1,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION_DELTA = 0x2,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER = 0x4,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER_DELTA = 0x8,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CDEF_DATA = 0x10,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CONTEXT_UPDATE_TILE_ID = 0x20,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_COMPOUND_PREDICTION_MODE = 0x40,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_PRIMARY_REF_FRAME = 0x80,
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_REFERENCE_INDICES = 0x100
+ } D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT
+ {
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS SupportedFeatureFlags;
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS RequiredFeatureFlags;
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS SupportedInterpolationFilters;
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS SupportedRestorationParams[ 3 ][ 3 ];
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS SupportedSegmentationModes;
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS SupportedTxModes[ 4 ];
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE SegmentationBlockSize;
+ D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS PostEncodeValuesFlags;
+ UINT MaxTemporalLayers;
+ UINT MaxSpatialLayers;
+ } D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE
+ {
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME = 0,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME = 1,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME = 2,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME = 3
+ } D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_KEY_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME ) ,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTER_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME ) ,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTRA_ONLY_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME ) ,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_SWITCH_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME )
+ } D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE
+ {
+ D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_SINGLE_REFERENCE = 0,
+ D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_COMPOUND_REFERENCE = 1
+ } D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT
+ {
+ D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE PredictionMode;
+ UINT MaxUniqueReferencesPerFrame;
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS SupportedFrameTypes;
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS SupportedReferenceWarpedMotionFlags;
+ } D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION
+ {
+ D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS FeatureFlags;
+ UINT OrderHintBitsMinus1;
+ } D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE
+ {
+ UINT IntraDistance;
+ UINT InterFramePeriod;
+ } D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO
+ {
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION TransformationType;
+ INT TransformationMatrix[ 8 ];
+ BOOL InvalidAffineSet;
+ } D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR
+ {
+ UINT ReconstructedPictureResourceIndex;
+ UINT TemporalLayerIndexPlus1;
+ UINT SpatialLayerIndexPlus1;
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType;
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo;
+ UINT OrderHint;
+ UINT PictureIndex;
+ } D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR;
+
+typedef
+enum D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_ERROR_RESILIENT_MODE = 0x1,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_CDF_UPDATE = 0x2,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_PALETTE_ENCODING = 0x4,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_SKIP_MODE = 0x8,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x10,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FORCE_INTEGER_MOTION_VECTORS = 0x20,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_INTRA_BLOCK_COPY = 0x40,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_USE_SUPER_RESOLUTION = 0x80,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_FRAME_END_UPDATE_CDF = 0x100,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_AUTO = 0x200,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_CUSTOM = 0x400,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_WARPED_MOTION = 0x800,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_REDUCED_TX_SET = 0x1000,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_MOTION_MODE_SWITCHABLE = 0x2000,
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_HIGH_PRECISION_MV = 0x4000
+ } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG
+ {
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE FrameRestorationType[ 3 ];
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE LoopRestorationPixelSize[ 3 ];
+ } D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA
+ {
+ UINT64 EnabledFeatures;
+ INT64 FeatureValue[ 8 ];
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG
+ {
+ UINT64 UpdateMap;
+ UINT64 TemporalUpdate;
+ UINT64 UpdateData;
+ UINT64 NumSegments;
+ D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA SegmentsData[ 8 ];
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP
+ {
+ UINT SegmentsMapByteSize;
+ UINT8 *pSegmentsMap;
+ } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG
+ {
+ UINT64 LoopFilterLevel[ 2 ];
+ UINT64 LoopFilterLevelU;
+ UINT64 LoopFilterLevelV;
+ UINT64 LoopFilterSharpnessLevel;
+ UINT64 LoopFilterDeltaEnabled;
+ UINT64 UpdateRefDelta;
+ INT64 RefDeltas[ 8 ];
+ UINT64 UpdateModeDelta;
+ INT64 ModeDeltas[ 2 ];
+ } D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG
+ {
+ UINT64 DeltaLFPresent;
+ UINT64 DeltaLFMulti;
+ UINT64 DeltaLFRes;
+ } D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG
+ {
+ UINT64 BaseQIndex;
+ INT64 YDCDeltaQ;
+ INT64 UDCDeltaQ;
+ INT64 UACDeltaQ;
+ INT64 VDCDeltaQ;
+ INT64 VACDeltaQ;
+ UINT64 UsingQMatrix;
+ UINT64 QMY;
+ UINT64 QMU;
+ UINT64 QMV;
+ } D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG
+ {
+ UINT64 DeltaQPresent;
+ UINT64 DeltaQRes;
+ } D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG
+ {
+ UINT64 CdefBits;
+ UINT64 CdefDampingMinus3;
+ UINT64 CdefYPriStrength[ 8 ];
+ UINT64 CdefUVPriStrength[ 8 ];
+ UINT64 CdefYSecStrength[ 8 ];
+ UINT64 CdefUVSecStrength[ 8 ];
+ } D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA
+ {
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType;
+ D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE CompoundPredictionType;
+ D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS InterpolationFilter;
+ D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG FrameRestorationConfig;
+ D3D12_VIDEO_ENCODER_AV1_TX_MODE TxMode;
+ UINT SuperResDenominator;
+ UINT OrderHint;
+ UINT PictureIndex;
+ UINT TemporalLayerIndexPlus1;
+ UINT SpatialLayerIndexPlus1;
+ D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR ReferenceFramesReconPictureDescriptors[ 8 ];
+ UINT ReferenceIndices[ 7 ];
+ UINT PrimaryRefFrame;
+ UINT RefreshFrameFlags;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta;
+ D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF;
+ UINT QPMapValuesCount;
+ _Field_size_full_(QPMapValuesCount) INT16 *pRateControlQPMap;
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG CustomSegmentation;
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP CustomSegmentsMap;
+ } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES
+ {
+ UINT64 RowCount;
+ UINT64 ColCount;
+ UINT64 RowHeights[ 64 ];
+ UINT64 ColWidths[ 64 ];
+ UINT64 ContextUpdateTileId;
+ } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES;
+
+typedef struct D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES
+ {
+ UINT64 CompoundPredictionType;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta;
+ D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF;
+ D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG SegmentationConfig;
+ UINT64 PrimaryRefFrame;
+ UINT64 ReferenceIndices[ 7 ];
+ } D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES;
+
+typedef
enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE
{
D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_ABSOLUTE_QP_MAP = 0,
@@ -6338,7 +6807,9 @@ enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS
D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4,
D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8,
D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10,
- D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_EXTENSION1_SUPPORT = 0x40,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QUALITY_VS_SPEED = 0x80
} D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS);
@@ -6349,6 +6820,14 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP
UINT ConstantQP_InterPredictedFrame_BiDirectionalRef;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP;
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1
+ {
+ UINT ConstantQP_FullIntracodedFrame;
+ UINT ConstantQP_InterPredictedFrame_PrevRefOnly;
+ UINT ConstantQP_InterPredictedFrame_BiDirectionalRef;
+ UINT QualityVsSpeed;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1;
+
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR
{
UINT InitialQP;
@@ -6360,6 +6839,18 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR
UINT64 InitialVBVFullness;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR;
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetBitRate;
+ UINT64 VBVCapacity;
+ UINT64 InitialVBVFullness;
+ UINT QualityVsSpeed;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1;
+
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR
{
UINT InitialQP;
@@ -6372,6 +6863,19 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR
UINT64 InitialVBVFullness;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR;
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetAvgBitRate;
+ UINT64 PeakBitRate;
+ UINT64 VBVCapacity;
+ UINT64 InitialVBVFullness;
+ UINT QualityVsSpeed;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1;
+
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR
{
UINT InitialQP;
@@ -6383,6 +6887,25 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR
UINT ConstantQualityTarget;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR;
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetAvgBitRate;
+ UINT64 PeakBitRate;
+ UINT ConstantQualityTarget;
+ UINT64 VBVCapacity;
+ UINT64 InitialVBVFullness;
+ UINT QualityVsSpeed;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP
+ {
+ UINT QualityVsSpeed;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP;
+
typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
{
UINT DataSize;
@@ -6392,6 +6915,11 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *pConfiguration_CBR;
const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *pConfiguration_VBR;
const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *pConfiguration_QVBR;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1 *pConfiguration_CQP1;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1 *pConfiguration_CBR1;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1 *pConfiguration_VBR1;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1 *pConfiguration_QVBR1;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP *pConfiguration_AbsoluteQPMap;
} ;
} D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;
@@ -6407,7 +6935,8 @@ typedef
enum D3D12_VIDEO_ENCODER_CODEC
{
D3D12_VIDEO_ENCODER_CODEC_H264 = 0,
- D3D12_VIDEO_ENCODER_CODEC_HEVC = 1
+ D3D12_VIDEO_ENCODER_CODEC_HEVC = 1,
+ D3D12_VIDEO_ENCODER_CODEC_AV1 = 2
} D3D12_VIDEO_ENCODER_CODEC;
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC
@@ -6439,6 +6968,7 @@ typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC
{
D3D12_VIDEO_ENCODER_PROFILE_H264 *pH264Profile;
D3D12_VIDEO_ENCODER_PROFILE_HEVC *pHEVCProfile;
+ D3D12_VIDEO_ENCODER_AV1_PROFILE *pAV1Profile;
} ;
} D3D12_VIDEO_ENCODER_PROFILE_DESC;
@@ -6505,6 +7035,7 @@ typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING
{
D3D12_VIDEO_ENCODER_LEVELS_H264 *pH264LevelSetting;
D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC *pHEVCLevelSetting;
+ D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS *pAV1LevelSetting;
} ;
} D3D12_VIDEO_ENCODER_LEVEL_SETTING;
@@ -6591,7 +7122,9 @@ enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1,
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2,
D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3,
- D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_GRID_PARTITION = 5,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_CONFIGURABLE_GRID_PARTITION = 6
} D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE;
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE
@@ -6605,6 +7138,58 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE
} D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE;
typedef
+enum D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NOT_SPECIFIED = 0x1,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_CODEC_CONSTRAINT = 0x2,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_HARDWARE_CONSTRAINT = 0x4,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_ROWS_COUNT = 0x8,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_COLS_COUNT = 0x10,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_WIDTH = 0x20,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_AREA = 0x40,
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_TOTAL_TILES = 0x80
+ } D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT
+ {
+ BOOL Use128SuperBlocks;
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES TilesConfiguration;
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS ValidationFlags;
+ UINT MinTileRows;
+ UINT MaxTileRows;
+ UINT MinTileCols;
+ UINT MaxTileCols;
+ UINT MinTileWidth;
+ UINT MaxTileWidth;
+ UINT MinTileArea;
+ UINT MaxTileArea;
+ UINT TileSizeBytesMinus1;
+ } D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT;
+
+typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT *pAV1Support;
+ } ;
+ } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING Level;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC FrameResolution;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT CodecSupport;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG;
+
+typedef
enum D3D12_VIDEO_ENCODER_HEAP_FLAGS
{
D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0
@@ -6728,6 +7313,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT
{
D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 *pH264Support;
D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC *pHEVCSupport;
+ D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT *pAV1Support;
} ;
} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT;
@@ -6765,6 +7351,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
{
D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 *pH264Support;
D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC *pHEVCSupport;
+ D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT *pAV1Support;
} ;
} D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;
@@ -6793,7 +7380,9 @@ enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS
D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200,
D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400,
D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800,
- D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_EXTENSION1_SUPPORT = 0x2000,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_QUALITY_VS_SPEED_AVAILABLE = 0x4000
} D3D12_VIDEO_ENCODER_SUPPORT_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS);
@@ -6855,6 +7444,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
{
D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 *pH264Config;
D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC *pHEVCConfig;
+ D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION *pAV1Config;
} ;
} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION;
@@ -6870,7 +7460,8 @@ enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE
D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0,
D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1,
D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2,
- D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3,
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_EIGHTH_PIXEL = 4
} D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE;
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS
@@ -6893,7 +7484,8 @@ enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS
D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80,
D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100,
D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200,
- D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_DATA_NOT_SUPPORTED = 0x1000
} D3D12_VIDEO_ENCODER_VALIDATION_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS);
@@ -6920,6 +7512,7 @@ typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
{
D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 *pH264GroupOfPictures;
D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC *pHEVCGroupOfPictures;
+ D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE *pAV1SequenceStructure;
} ;
} D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;
@@ -6943,6 +7536,50 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
_Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT;
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES
+ {
+ union
+ {
+ UINT MaxBytesPerSlice;
+ UINT NumberOfCodingUnitsPerSlice;
+ UINT NumberOfRowsPerSlice;
+ UINT NumberOfSlicesPerFrame;
+ } ;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
+ {
+ UINT DataSize;
+ union
+ {
+ const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264;
+ const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC;
+ const D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES *pTilesPartition_AV1;
+ } ;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
+ D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding;
+ UINT ResolutionsListCount;
+ const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList;
+ UINT MaxReferenceFramesInDPB;
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags;
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel;
+ _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA SubregionFrameEncodingData;
+ UINT MaxQualityVsSpeed;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1;
+
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS
{
UINT NodeIndex;
@@ -7716,6 +8353,7 @@ typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
{
D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 *pH264PicData;
D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC *pHEVCPicData;
+ D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA *pAV1PicData;
} ;
} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA;
@@ -7754,27 +8392,6 @@ enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS
} D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS);
-typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES
- {
- union
- {
- UINT MaxBytesPerSlice;
- UINT NumberOfCodingUnitsPerSlice;
- UINT NumberOfRowsPerSlice;
- UINT NumberOfSlicesPerFrame;
- } ;
- } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES;
-
-typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
- {
- UINT DataSize;
- union
- {
- const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264;
- const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC;
- } ;
- } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA;
-
typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
{
D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags;
diff --git a/thirdparty/directx_headers/d3dcommon.h b/thirdparty/directx_headers/include/directx/d3dcommon.h
index 33e7762374..974f205a60 100644
--- a/thirdparty/directx_headers/d3dcommon.h
+++ b/thirdparty/directx_headers/include/directx/d3dcommon.h
@@ -93,6 +93,7 @@ enum D3D_DRIVER_TYPE
typedef
enum D3D_FEATURE_LEVEL
{
+ D3D_FEATURE_LEVEL_1_0_GENERIC = 0x100,
D3D_FEATURE_LEVEL_1_0_CORE = 0x1000,
D3D_FEATURE_LEVEL_9_1 = 0x9100,
D3D_FEATURE_LEVEL_9_2 = 0x9200,
diff --git a/thirdparty/directx_headers/include/directx/d3dx12.h b/thirdparty/directx_headers/include/directx/d3dx12.h
new file mode 100644
index 0000000000..1187816c1e
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12.h
@@ -0,0 +1,35 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#ifndef __D3DX12_H__
+#define __D3DX12_H__
+
+#include "d3d12.h"
+
+#if defined( __cplusplus )
+
+#include "d3dx12_barriers.h"
+#include "d3dx12_core.h"
+#include "d3dx12_default.h"
+#include "d3dx12_pipeline_state_stream.h"
+#include "d3dx12_render_pass.h"
+#include "d3dx12_resource_helpers.h"
+#include "d3dx12_root_signature.h"
+#include "d3dx12_property_format_table.h"
+
+#ifndef D3DX12_NO_STATE_OBJECT_HELPERS
+#include "d3dx12_state_object.h"
+#endif // !D3DX12_NO_STATE_OBJECT_HELPERS
+
+#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
+#include "d3dx12_check_feature_support.h"
+#endif // !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS
+
+#endif // defined( __cplusplus )
+
+#endif //__D3DX12_H__
+
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_barriers.h b/thirdparty/directx_headers/include/directx/d3dx12_barriers.h
new file mode 100644
index 0000000000..2c2b135a62
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_barriers.h
@@ -0,0 +1,192 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#ifndef __D3DX12_BARRIERS_H__
+#define __D3DX12_BARRIERS_H__
+
+#if defined( __cplusplus )
+
+#include "d3d12.h"
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
+{
+ CD3DX12_RESOURCE_BARRIER() = default;
+ explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) noexcept :
+ 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) noexcept
+ {
+ 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_opt_ ID3D12Resource* pResourceBefore,
+ _In_opt_ ID3D12Resource* pResourceAfter) noexcept
+ {
+ 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_opt_ ID3D12Resource* pResource) noexcept
+ {
+ CD3DX12_RESOURCE_BARRIER result = {};
+ D3D12_RESOURCE_BARRIER &barrier = result;
+ result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
+ barrier.UAV.pResource = pResource;
+ return result;
+ }
+};
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+
+//================================================================================================
+// D3DX12 Enhanced Barrier Helpers
+//================================================================================================
+
+class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE
+{
+public:
+ CD3DX12_BARRIER_SUBRESOURCE_RANGE() = default;
+ CD3DX12_BARRIER_SUBRESOURCE_RANGE(const D3D12_BARRIER_SUBRESOURCE_RANGE &o) noexcept :
+ D3D12_BARRIER_SUBRESOURCE_RANGE(o)
+ {}
+ explicit CD3DX12_BARRIER_SUBRESOURCE_RANGE(UINT Subresource) noexcept :
+ D3D12_BARRIER_SUBRESOURCE_RANGE{ Subresource, 0, 0, 0, 0, 0 }
+ {}
+ CD3DX12_BARRIER_SUBRESOURCE_RANGE(
+ UINT firstMipLevel,
+ UINT numMips,
+ UINT firstArraySlice,
+ UINT numArraySlices,
+ UINT firstPlane = 0,
+ UINT numPlanes = 1) noexcept :
+ D3D12_BARRIER_SUBRESOURCE_RANGE
+ {
+ firstMipLevel,
+ numMips,
+ firstArraySlice,
+ numArraySlices,
+ firstPlane,
+ numPlanes
+ }
+ {}
+};
+
+class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER
+{
+public:
+ CD3DX12_GLOBAL_BARRIER() = default;
+ CD3DX12_GLOBAL_BARRIER(const D3D12_GLOBAL_BARRIER &o) noexcept : D3D12_GLOBAL_BARRIER(o){}
+ CD3DX12_GLOBAL_BARRIER(
+ D3D12_BARRIER_SYNC syncBefore,
+ D3D12_BARRIER_SYNC syncAfter,
+ D3D12_BARRIER_ACCESS accessBefore,
+ D3D12_BARRIER_ACCESS accessAfter) noexcept : D3D12_GLOBAL_BARRIER {
+ syncBefore,
+ syncAfter,
+ accessBefore,
+ accessAfter
+ }
+ {}
+};
+
+class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER
+{
+public:
+ CD3DX12_BUFFER_BARRIER() = default;
+ CD3DX12_BUFFER_BARRIER(const D3D12_BUFFER_BARRIER &o) noexcept : D3D12_BUFFER_BARRIER(o){}
+ CD3DX12_BUFFER_BARRIER(
+ D3D12_BARRIER_SYNC syncBefore,
+ D3D12_BARRIER_SYNC syncAfter,
+ D3D12_BARRIER_ACCESS accessBefore,
+ D3D12_BARRIER_ACCESS accessAfter,
+ ID3D12Resource *pRes) noexcept : D3D12_BUFFER_BARRIER {
+ syncBefore,
+ syncAfter,
+ accessBefore,
+ accessAfter,
+ pRes,
+ 0, ULLONG_MAX
+ }
+ {}
+};
+
+class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER
+{
+public:
+ CD3DX12_TEXTURE_BARRIER() = default;
+ CD3DX12_TEXTURE_BARRIER(const D3D12_TEXTURE_BARRIER &o) noexcept : D3D12_TEXTURE_BARRIER(o){}
+ CD3DX12_TEXTURE_BARRIER(
+ D3D12_BARRIER_SYNC syncBefore,
+ D3D12_BARRIER_SYNC syncAfter,
+ D3D12_BARRIER_ACCESS accessBefore,
+ D3D12_BARRIER_ACCESS accessAfter,
+ D3D12_BARRIER_LAYOUT layoutBefore,
+ D3D12_BARRIER_LAYOUT layoutAfter,
+ ID3D12Resource *pRes,
+ const D3D12_BARRIER_SUBRESOURCE_RANGE &subresources,
+ D3D12_TEXTURE_BARRIER_FLAGS flag = D3D12_TEXTURE_BARRIER_FLAG_NONE) noexcept : D3D12_TEXTURE_BARRIER {
+ syncBefore,
+ syncAfter,
+ accessBefore,
+ accessAfter,
+ layoutBefore,
+ layoutAfter,
+ pRes,
+ subresources,
+ flag
+ }
+ {}
+};
+
+class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP
+{
+public:
+ CD3DX12_BARRIER_GROUP() = default;
+ CD3DX12_BARRIER_GROUP(const D3D12_BARRIER_GROUP &o) noexcept : D3D12_BARRIER_GROUP(o){}
+ CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_BUFFER_BARRIER *pBarriers) noexcept
+ {
+ Type = D3D12_BARRIER_TYPE_BUFFER;
+ NumBarriers = numBarriers;
+ pBufferBarriers = pBarriers;
+ }
+ CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_TEXTURE_BARRIER *pBarriers) noexcept
+ {
+ Type = D3D12_BARRIER_TYPE_TEXTURE;
+ NumBarriers = numBarriers;
+ pTextureBarriers = pBarriers;
+ }
+ CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_GLOBAL_BARRIER *pBarriers) noexcept
+ {
+ Type = D3D12_BARRIER_TYPE_GLOBAL;
+ NumBarriers = numBarriers;
+ pGlobalBarriers = pBarriers;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 608
+
+
+#endif // defined( __cplusplus )
+
+#endif // __D3DX12_BARRIERS_H__
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h b/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h
new file mode 100644
index 0000000000..653a422d03
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h
@@ -0,0 +1,1107 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+
+//================================================================================================
+// D3DX12 Check Feature Support
+//================================================================================================
+
+#include <vector>
+
+class CD3DX12FeatureSupport
+{
+public: // Function declaration
+ // Default constructor that creates an empty object
+ CD3DX12FeatureSupport() noexcept;
+
+ // Initialize data from the given device
+ HRESULT Init(ID3D12Device* pDevice);
+
+ // Retreives the status of the object. If an error occurred in the initialization process, the function returns the error code.
+ HRESULT GetStatus() const noexcept { return m_hStatus; }
+
+ // Getter functions for each feature class
+ // D3D12_OPTIONS
+ BOOL DoublePrecisionFloatShaderOps() const noexcept;
+ BOOL OutputMergerLogicOp() const noexcept;
+ D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport() const noexcept;
+ D3D12_TILED_RESOURCES_TIER TiledResourcesTier() const noexcept;
+ D3D12_RESOURCE_BINDING_TIER ResourceBindingTier() const noexcept;
+ BOOL PSSpecifiedStencilRefSupported() const noexcept;
+ BOOL TypedUAVLoadAdditionalFormats() const noexcept;
+ BOOL ROVsSupported() const noexcept;
+ D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier() const noexcept;
+ BOOL StandardSwizzle64KBSupported() const noexcept;
+ BOOL CrossAdapterRowMajorTextureSupported() const noexcept;
+ BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation() const noexcept;
+ D3D12_RESOURCE_HEAP_TIER ResourceHeapTier() const noexcept;
+ D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier() const noexcept;
+ UINT MaxGPUVirtualAddressBitsPerResource() const noexcept;
+
+ // FEATURE_LEVELS
+ D3D_FEATURE_LEVEL MaxSupportedFeatureLevel() const noexcept;
+
+ // FORMAT_SUPPORT
+ HRESULT FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const;
+
+ // MUTLTISAMPLE_QUALITY_LEVELS
+ HRESULT MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const;
+
+ // FORMAT_INFO
+ HRESULT FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const;
+
+ // GPU_VIRTUAL_ADDRESS_SUPPORT
+ UINT MaxGPUVirtualAddressBitsPerProcess() const noexcept;
+
+ // SHADER_MODEL
+ D3D_SHADER_MODEL HighestShaderModel() const noexcept;
+
+ // D3D12_OPTIONS1
+ BOOL WaveOps() const noexcept;
+ UINT WaveLaneCountMin() const noexcept;
+ UINT WaveLaneCountMax() const noexcept;
+ UINT TotalLaneCount() const noexcept;
+ BOOL ExpandedComputeResourceStates() const noexcept;
+ BOOL Int64ShaderOps() const noexcept;
+
+ // PROTECTED_RESOURCE_SESSION_SUPPORT
+ D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ProtectedResourceSessionSupport(UINT NodeIndex = 0) const;
+
+ // ROOT_SIGNATURE
+ D3D_ROOT_SIGNATURE_VERSION HighestRootSignatureVersion() const noexcept;
+
+ // ARCHITECTURE1
+ BOOL TileBasedRenderer(UINT NodeIndex = 0) const;
+ BOOL UMA(UINT NodeIndex = 0) const;
+ BOOL CacheCoherentUMA(UINT NodeIndex = 0) const;
+ BOOL IsolatedMMU(UINT NodeIndex = 0) const;
+
+ // D3D12_OPTIONS2
+ BOOL DepthBoundsTestSupported() const noexcept;
+ D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const noexcept;
+
+ // SHADER_CACHE
+ D3D12_SHADER_CACHE_SUPPORT_FLAGS ShaderCacheSupportFlags() const noexcept;
+
+ // COMMAND_QUEUE_PRIORITY
+ BOOL CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority);
+
+ // D3D12_OPTIONS3
+ BOOL CopyQueueTimestampQueriesSupported() const noexcept;
+ BOOL CastingFullyTypedFormatSupported() const noexcept;
+ D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags() const noexcept;
+ D3D12_VIEW_INSTANCING_TIER ViewInstancingTier() const noexcept;
+ BOOL BarycentricsSupported() const noexcept;
+
+ // EXISTING_HEAPS
+ BOOL ExistingHeapsSupported() const noexcept;
+
+ // D3D12_OPTIONS4
+ BOOL MSAA64KBAlignedTextureSupported() const noexcept;
+ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier() const noexcept;
+ BOOL Native16BitShaderOpsSupported() const noexcept;
+
+ // SERIALIZATION
+ D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier(UINT NodeIndex = 0) const;
+
+ // CROSS_NODE
+ // CrossNodeSharingTier handled in D3D12Options
+ BOOL CrossNodeAtomicShaderInstructions() const noexcept;
+
+ // D3D12_OPTIONS5
+ BOOL SRVOnlyTiledResourceTier3() const noexcept;
+ D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept;
+ D3D12_RAYTRACING_TIER RaytracingTier() const noexcept;
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ // DISPLAYABLE
+ BOOL DisplayableTexture() const noexcept;
+ // SharedResourceCompatibilityTier handled in D3D12Options4
+#endif
+
+ // D3D12_OPTIONS6
+ BOOL AdditionalShadingRatesSupported() const noexcept;
+ BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing() const noexcept;
+ D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier() const noexcept;
+ UINT ShadingRateImageTileSize() const noexcept;
+ BOOL BackgroundProcessingSupported() const noexcept;
+
+ // QUERY_META_COMMAND
+ HRESULT QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const;
+
+ // D3D12_OPTIONS7
+ D3D12_MESH_SHADER_TIER MeshShaderTier() const noexcept;
+ D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier() const noexcept;
+
+ // PROTECTED_RESOURCE_SESSION_TYPE_COUNT
+ UINT ProtectedResourceSessionTypeCount(UINT NodeIndex = 0) const;
+
+ // PROTECTED_RESOURCE_SESSION_TYPES
+ std::vector<GUID> ProtectedResourceSessionTypes(UINT NodeIndex = 0) const;
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+ // D3D12_OPTIONS8
+ BOOL UnalignedBlockTexturesSupported() const noexcept;
+
+ // D3D12_OPTIONS9
+ BOOL MeshShaderPipelineStatsSupported() const noexcept;
+ BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex() const noexcept;
+ BOOL AtomicInt64OnTypedResourceSupported() const noexcept;
+ BOOL AtomicInt64OnGroupSharedSupported() const noexcept;
+ BOOL DerivativesInMeshAndAmplificationShadersSupported() const noexcept;
+ D3D12_WAVE_MMA_TIER WaveMMATier() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ // D3D12_OPTIONS10
+ BOOL VariableRateShadingSumCombinerSupported() const noexcept;
+ BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept;
+
+ // D3D12_OPTIONS11
+ BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 600)
+ // D3D12_OPTIONS12
+ D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives() const noexcept;
+ BOOL EnhancedBarriersSupported() const noexcept;
+ BOOL RelaxedFormatCastingSupported() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 602)
+ // D3D12_OPTIONS13
+ BOOL UnrestrictedBufferTextureCopyPitchSupported() const noexcept;
+ BOOL UnrestrictedVertexElementAlignmentSupported() const noexcept;
+ BOOL InvertedViewportHeightFlipsYSupported() const noexcept;
+ BOOL InvertedViewportDepthFlipsZSupported() const noexcept;
+ BOOL TextureCopyBetweenDimensionsSupported() const noexcept;
+ BOOL AlphaBlendFactorSupported() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ // D3D12_OPTIONS14
+ BOOL AdvancedTextureOpsSupported() const noexcept;
+ BOOL WriteableMSAATexturesSupported() const noexcept;
+ BOOL IndependentFrontAndBackStencilRefMaskSupported() const noexcept;
+
+ // D3D12_OPTIONS15
+ BOOL TriangleFanSupported() const noexcept;
+ BOOL DynamicIndexBufferStripCutSupported() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ // D3D12_OPTIONS16
+ BOOL DynamicDepthBiasSupported() const noexcept;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ BOOL GPUUploadHeapSupported() const noexcept;
+
+ // D3D12_OPTIONS17
+ BOOL NonNormalizedCoordinateSamplersSupported() const noexcept;
+ BOOL ManualWriteTrackingResourceSupported() const noexcept;
+
+ // D3D12_OPTIONS18
+ BOOL RenderPassesValid() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+ BOOL MismatchingOutputDimensionsSupported() const noexcept;
+ UINT SupportedSampleCountsWithNoOutputs() const noexcept;
+ BOOL PointSamplingAddressesNeverRoundUp() const noexcept;
+ BOOL RasterizerDesc2Supported() const noexcept;
+ BOOL NarrowQuadrilateralLinesSupported() const noexcept;
+ BOOL AnisoFilterWithPointMipSupported() const noexcept;
+ UINT MaxSamplerDescriptorHeapSize() const noexcept;
+ UINT MaxSamplerDescriptorHeapSizeWithStaticSamplers() const noexcept;
+ UINT MaxViewDescriptorHeapSize() const noexcept;
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611)
+ BOOL ComputeOnlyWriteWatchSupported() const noexcept;
+#endif
+
+private: // Private structs and helpers declaration
+ struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES
+ {
+ std::vector<GUID> TypeVec;
+ };
+
+ // Helper function to decide the highest shader model supported by the system
+ // Stores the result in m_dShaderModel
+ // Must be updated whenever a new shader model is added to the d3d12.h header
+ HRESULT QueryHighestShaderModel();
+
+ // Helper function to decide the highest root signature supported
+ // Must be updated whenever a new root signature version is added to the d3d12.h header
+ HRESULT QueryHighestRootSignatureVersion();
+
+ // Helper funcion to decide the highest feature level
+ HRESULT QueryHighestFeatureLevel();
+
+ // Helper function to initialize local protected resource session types structs
+ HRESULT QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count);
+
+private: // Member data
+ // Pointer to the underlying device
+ ID3D12Device* m_pDevice;
+
+ // Stores the error code from initialization
+ HRESULT m_hStatus;
+
+ // Feature support data structs
+ D3D12_FEATURE_DATA_D3D12_OPTIONS m_dOptions;
+ D3D_FEATURE_LEVEL m_eMaxFeatureLevel;
+ D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT m_dGPUVASupport;
+ D3D12_FEATURE_DATA_SHADER_MODEL m_dShaderModel;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS1 m_dOptions1;
+ std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT> m_dProtectedResourceSessionSupport;
+ D3D12_FEATURE_DATA_ROOT_SIGNATURE m_dRootSignature;
+ std::vector<D3D12_FEATURE_DATA_ARCHITECTURE1> m_dArchitecture1;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS2 m_dOptions2;
+ D3D12_FEATURE_DATA_SHADER_CACHE m_dShaderCache;
+ D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY m_dCommandQueuePriority;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS3 m_dOptions3;
+ D3D12_FEATURE_DATA_EXISTING_HEAPS m_dExistingHeaps;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS4 m_dOptions4;
+ std::vector<D3D12_FEATURE_DATA_SERIALIZATION> m_dSerialization; // Cat2 NodeIndex
+ D3D12_FEATURE_DATA_CROSS_NODE m_dCrossNode;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS5 m_dOptions5;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ D3D12_FEATURE_DATA_DISPLAYABLE m_dDisplayable;
+#endif
+ D3D12_FEATURE_DATA_D3D12_OPTIONS6 m_dOptions6;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS7 m_dOptions7;
+ std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT> m_dProtectedResourceSessionTypeCount; // Cat2 NodeIndex
+ std::vector<ProtectedResourceSessionTypesLocal> m_dProtectedResourceSessionTypes; // Cat3
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS8 m_dOptions8;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS9 m_dOptions9;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS10 m_dOptions10;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS11 m_dOptions11;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 600)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS12 m_dOptions12;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 602)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS13 m_dOptions13;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS14 m_dOptions14;
+ D3D12_FEATURE_DATA_D3D12_OPTIONS15 m_dOptions15;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS16 m_dOptions16;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS17 m_dOptions17;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS18 m_dOptions18;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS19 m_dOptions19;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611)
+ D3D12_FEATURE_DATA_D3D12_OPTIONS20 m_dOptions20;
+#endif
+};
+
+// Implementations for CD3DX12FeatureSupport functions
+
+// Macro to set up a getter function for each entry in feature support data
+// The getter function will have the same name as the feature option name
+#define FEATURE_SUPPORT_GET(RETTYPE,FEATURE,OPTION) \
+inline RETTYPE CD3DX12FeatureSupport::OPTION() const noexcept \
+{ \
+ return FEATURE.OPTION; \
+}
+
+// Macro to set up a getter function for each entry in feature support data
+// Also specifies the name for the function which can be different from the feature name
+#define FEATURE_SUPPORT_GET_NAME(RETTYPE,FEATURE,OPTION,NAME) \
+inline RETTYPE CD3DX12FeatureSupport::NAME() const noexcept \
+{\
+ return FEATURE.OPTION; \
+}
+
+// Macro to set up a getter function for feature data indexed by the graphics node ID
+// The default parameter is 0, or the first availabe graphics device node
+#define FEATURE_SUPPORT_GET_NODE_INDEXED(RETTYPE,FEATURE,OPTION) \
+inline RETTYPE CD3DX12FeatureSupport::OPTION(UINT NodeIndex) const \
+{\
+ return FEATURE[NodeIndex].OPTION; \
+}
+
+// Macro to set up a getter function for feature data indexed by NodeIndex
+// Allows a custom name for the getter function
+#define FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(RETTYPE,FEATURE,OPTION,NAME) \
+inline RETTYPE CD3DX12FeatureSupport::NAME(UINT NodeIndex) const \
+{\
+ return FEATURE[NodeIndex].OPTION; \
+}
+
+inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept
+: m_pDevice(nullptr)
+, m_hStatus(E_INVALIDARG)
+, m_dOptions{}
+, m_eMaxFeatureLevel{}
+, m_dGPUVASupport{}
+, m_dShaderModel{}
+, m_dOptions1{}
+, m_dRootSignature{}
+, m_dOptions2{}
+, m_dShaderCache{}
+, m_dCommandQueuePriority{}
+, m_dOptions3{}
+, m_dExistingHeaps{}
+, m_dOptions4{}
+, m_dCrossNode{}
+, m_dOptions5{}
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+, m_dDisplayable{}
+#endif
+, m_dOptions6{}
+, m_dOptions7{}
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+, m_dOptions8{}
+, m_dOptions9{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+, m_dOptions10{}
+, m_dOptions11{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 600)
+, m_dOptions12{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 602)
+, m_dOptions13{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+, m_dOptions14{}
+, m_dOptions15{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+, m_dOptions16{}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+, m_dOptions17{}
+#endif
+#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+, m_dOptions18{}
+#endif
+#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+, m_dOptions19{}
+#endif
+#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611)
+, m_dOptions20{}
+#endif
+{}
+
+inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice)
+{
+ if (!pDevice)
+ {
+ m_hStatus = E_INVALIDARG;
+ return m_hStatus;
+ }
+
+ m_pDevice = pDevice;
+
+ // Initialize static feature support data structures
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_dOptions, sizeof(m_dOptions))))
+ {
+ m_dOptions = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT, &m_dGPUVASupport, sizeof(m_dGPUVASupport))))
+ {
+ m_dGPUVASupport = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &m_dOptions1, sizeof(m_dOptions1))))
+ {
+ m_dOptions1 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2, &m_dOptions2, sizeof(m_dOptions2))))
+ {
+ m_dOptions2 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_CACHE, &m_dShaderCache, sizeof(m_dShaderCache))))
+ {
+ m_dShaderCache = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &m_dOptions3, sizeof(m_dOptions3))))
+ {
+ m_dOptions3 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_EXISTING_HEAPS, &m_dExistingHeaps, sizeof(m_dExistingHeaps))))
+ {
+ m_dExistingHeaps = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &m_dOptions4, sizeof(m_dOptions4))))
+ {
+ m_dOptions4 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_CROSS_NODE, &m_dCrossNode, sizeof(m_dCrossNode))))
+ {
+ m_dCrossNode = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &m_dOptions5, sizeof(m_dOptions5))))
+ {
+ m_dOptions5 = {};
+ }
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_DISPLAYABLE, &m_dDisplayable, sizeof(m_dDisplayable))))
+ {
+ m_dDisplayable = {};
+ }
+#endif
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &m_dOptions6, sizeof(m_dOptions6))))
+ {
+ m_dOptions6 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &m_dOptions7, sizeof(m_dOptions7))))
+ {
+ m_dOptions7 = {};
+ }
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &m_dOptions8, sizeof(m_dOptions8))))
+ {
+ m_dOptions8 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS9, &m_dOptions9, sizeof(m_dOptions9))))
+ {
+ m_dOptions9 = {};
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS10, &m_dOptions10, sizeof(m_dOptions10))))
+ {
+ m_dOptions10 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS11, &m_dOptions11, sizeof(m_dOptions11))))
+ {
+ m_dOptions11 = {};
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 600)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &m_dOptions12, sizeof(m_dOptions12))))
+ {
+ m_dOptions12 = {};
+ m_dOptions12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE::D3D12_TRI_STATE_UNKNOWN;
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 602)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS13, &m_dOptions13, sizeof(m_dOptions13))))
+ {
+ m_dOptions13 = {};
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &m_dOptions14, sizeof(m_dOptions14))))
+ {
+ m_dOptions14 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS15, &m_dOptions15, sizeof(m_dOptions15))))
+ {
+ m_dOptions15 = {};
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS16, &m_dOptions16, sizeof(m_dOptions16))))
+ {
+ m_dOptions16 = {};
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS17, &m_dOptions17, sizeof(m_dOptions17))))
+ {
+ m_dOptions17 = {};
+ }
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS18, &m_dOptions18, sizeof(m_dOptions18))))
+ {
+ m_dOptions18.RenderPassesValid = false;
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS19, &m_dOptions19, sizeof(m_dOptions19))))
+ {
+ m_dOptions19 = {};
+ m_dOptions19.SupportedSampleCountsWithNoOutputs = 1;
+ m_dOptions19.MaxSamplerDescriptorHeapSize = D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE;
+ m_dOptions19.MaxSamplerDescriptorHeapSizeWithStaticSamplers = D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE;
+ m_dOptions19.MaxViewDescriptorHeapSize = D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1;
+ }
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611)
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS20, &m_dOptions20, sizeof(m_dOptions20))))
+ {
+ m_dOptions20 = {};
+ }
+#endif
+
+ // Initialize per-node feature support data structures
+ const UINT uNodeCount = m_pDevice->GetNodeCount();
+ m_dProtectedResourceSessionSupport.resize(uNodeCount);
+ m_dArchitecture1.resize(uNodeCount);
+ m_dSerialization.resize(uNodeCount);
+ m_dProtectedResourceSessionTypeCount.resize(uNodeCount);
+ m_dProtectedResourceSessionTypes.resize(uNodeCount);
+ for (UINT NodeIndex = 0; NodeIndex < uNodeCount; NodeIndex++)
+ {
+ m_dProtectedResourceSessionSupport[NodeIndex].NodeIndex = NodeIndex;
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT, &m_dProtectedResourceSessionSupport[NodeIndex], sizeof(m_dProtectedResourceSessionSupport[NodeIndex]))))
+ {
+ m_dProtectedResourceSessionSupport[NodeIndex].Support = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE;
+ }
+
+ m_dArchitecture1[NodeIndex].NodeIndex = NodeIndex;
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1, &m_dArchitecture1[NodeIndex], sizeof(m_dArchitecture1[NodeIndex]))))
+ {
+ D3D12_FEATURE_DATA_ARCHITECTURE dArchLocal = {};
+ dArchLocal.NodeIndex = NodeIndex;
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &dArchLocal, sizeof(dArchLocal))))
+ {
+ dArchLocal.TileBasedRenderer = false;
+ dArchLocal.UMA = false;
+ dArchLocal.CacheCoherentUMA = false;
+ }
+
+ m_dArchitecture1[NodeIndex].TileBasedRenderer = dArchLocal.TileBasedRenderer;
+ m_dArchitecture1[NodeIndex].UMA = dArchLocal.UMA;
+ m_dArchitecture1[NodeIndex].CacheCoherentUMA = dArchLocal.CacheCoherentUMA;
+ m_dArchitecture1[NodeIndex].IsolatedMMU = false;
+ }
+
+ m_dSerialization[NodeIndex].NodeIndex = NodeIndex;
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SERIALIZATION, &m_dSerialization[NodeIndex], sizeof(m_dSerialization[NodeIndex]))))
+ {
+ m_dSerialization[NodeIndex].HeapSerializationTier = D3D12_HEAP_SERIALIZATION_TIER_0;
+ }
+
+ m_dProtectedResourceSessionTypeCount[NodeIndex].NodeIndex = NodeIndex;
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT, &m_dProtectedResourceSessionTypeCount[NodeIndex], sizeof(m_dProtectedResourceSessionTypeCount[NodeIndex]))))
+ {
+ m_dProtectedResourceSessionTypeCount[NodeIndex].Count = 0;
+ }
+
+ // Special procedure to initialize local protected resource session types structs
+ // Must wait until session type count initialized
+ QueryProtectedResourceSessionTypes(NodeIndex, m_dProtectedResourceSessionTypeCount[NodeIndex].Count);
+ }
+
+ // Initialize features that requires highest version check
+ if (FAILED(m_hStatus = QueryHighestShaderModel()))
+ {
+ return m_hStatus;
+ }
+
+ if (FAILED(m_hStatus = QueryHighestRootSignatureVersion()))
+ {
+ return m_hStatus;
+ }
+
+ // Initialize Feature Levels data
+ if (FAILED(m_hStatus = QueryHighestFeatureLevel()))
+ {
+ return m_hStatus;
+ }
+
+ return m_hStatus;
+}
+
+// 0: D3D12_OPTIONS
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, DoublePrecisionFloatShaderOps);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, OutputMergerLogicOp);
+FEATURE_SUPPORT_GET(D3D12_SHADER_MIN_PRECISION_SUPPORT, m_dOptions, MinPrecisionSupport);
+FEATURE_SUPPORT_GET(D3D12_TILED_RESOURCES_TIER, m_dOptions, TiledResourcesTier);
+FEATURE_SUPPORT_GET(D3D12_RESOURCE_BINDING_TIER, m_dOptions, ResourceBindingTier);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, PSSpecifiedStencilRefSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, TypedUAVLoadAdditionalFormats);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, ROVsSupported);
+FEATURE_SUPPORT_GET(D3D12_CONSERVATIVE_RASTERIZATION_TIER, m_dOptions, ConservativeRasterizationTier);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, StandardSwizzle64KBSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, CrossAdapterRowMajorTextureSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions, VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation);
+FEATURE_SUPPORT_GET(D3D12_RESOURCE_HEAP_TIER, m_dOptions, ResourceHeapTier);
+
+// Special procedure for handling caps that is also part of other features
+inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier() const noexcept
+{
+ if (m_dCrossNode.SharingTier > D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED)
+ {
+ return m_dCrossNode.SharingTier;
+ }
+ else
+ {
+ return m_dOptions.CrossNodeSharingTier;
+ }
+}
+
+inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const noexcept
+{
+ if (m_dOptions.MaxGPUVirtualAddressBitsPerResource > 0)
+ {
+ return m_dOptions.MaxGPUVirtualAddressBitsPerResource;
+ }
+ else
+ {
+ return m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource;
+ }
+}
+
+// 1: Architecture
+// Combined with Architecture1
+
+// 2: Feature Levels
+// Simply returns the highest supported feature level
+inline D3D_FEATURE_LEVEL CD3DX12FeatureSupport::MaxSupportedFeatureLevel() const noexcept
+{
+ return m_eMaxFeatureLevel;
+}
+
+// 3: Feature Format Support
+inline HRESULT CD3DX12FeatureSupport::FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const
+{
+ D3D12_FEATURE_DATA_FORMAT_SUPPORT dFormatSupport;
+ dFormatSupport.Format = Format;
+
+ // It is possible that the function call returns an error
+ HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dFormatSupport, sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT));
+
+ Support1 = dFormatSupport.Support1;
+ Support2 = dFormatSupport.Support2; // Two outputs. Probably better just to take in the struct as an argument?
+
+ return result;
+}
+
+// 4: Multisample Quality Levels
+inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const
+{
+ D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS dMultisampleQualityLevels;
+ dMultisampleQualityLevels.Format = Format;
+ dMultisampleQualityLevels.SampleCount = SampleCount;
+ dMultisampleQualityLevels.Flags = Flags;
+
+ HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &dMultisampleQualityLevels, sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS));
+
+ if (SUCCEEDED(result))
+ {
+ NumQualityLevels = dMultisampleQualityLevels.NumQualityLevels;
+ }
+ else
+ {
+ NumQualityLevels = 0;
+ }
+
+ return result;
+}
+
+// 5: Format Info
+inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const
+{
+ D3D12_FEATURE_DATA_FORMAT_INFO dFormatInfo;
+ dFormatInfo.Format = Format;
+
+ HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &dFormatInfo, sizeof(D3D12_FEATURE_DATA_FORMAT_INFO));
+ if (FAILED(result))
+ {
+ PlaneCount = 0;
+ }
+ else
+ {
+ PlaneCount = dFormatInfo.PlaneCount;
+ }
+ return result;
+}
+
+// 6: GPU Virtual Address Support
+// MaxGPUVirtualAddressBitsPerResource handled in D3D12Options
+FEATURE_SUPPORT_GET(UINT, m_dGPUVASupport, MaxGPUVirtualAddressBitsPerProcess);
+
+// 7: Shader Model
+inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const noexcept
+{
+ return m_dShaderModel.HighestShaderModel;
+}
+
+// 8: D3D12 Options1
+FEATURE_SUPPORT_GET(BOOL, m_dOptions1, WaveOps);
+FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMin);
+FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMax);
+FEATURE_SUPPORT_GET(UINT, m_dOptions1, TotalLaneCount);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions1, ExpandedComputeResourceStates);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions1, Int64ShaderOps);
+
+// 10: Protected Resource Session Support
+inline D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS CD3DX12FeatureSupport::ProtectedResourceSessionSupport(UINT NodeIndex) const
+{
+ return m_dProtectedResourceSessionSupport[NodeIndex].Support;
+}
+
+// 12: Root Signature
+inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const noexcept
+{
+ return m_dRootSignature.HighestVersion;
+}
+
+// 16: Architecture1
+// Same data fields can be queried from m_dArchitecture
+FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, TileBasedRenderer);
+FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, UMA);
+FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, CacheCoherentUMA);
+FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, IsolatedMMU);
+
+// 18: D3D12 Options2
+FEATURE_SUPPORT_GET(BOOL, m_dOptions2, DepthBoundsTestSupported);
+FEATURE_SUPPORT_GET(D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER, m_dOptions2, ProgrammableSamplePositionsTier);
+
+// 19: Shader Cache
+FEATURE_SUPPORT_GET_NAME(D3D12_SHADER_CACHE_SUPPORT_FLAGS, m_dShaderCache, SupportFlags, ShaderCacheSupportFlags);
+
+// 20: Command Queue Priority
+inline BOOL CD3DX12FeatureSupport::CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority)
+{
+ m_dCommandQueuePriority.CommandListType = CommandListType;
+ m_dCommandQueuePriority.Priority = Priority;
+
+ if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &m_dCommandQueuePriority, sizeof(D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY))))
+ {
+ return false;
+ }
+
+ return m_dCommandQueuePriority.PriorityForTypeIsSupported;
+}
+
+// 21: D3D12 Options3
+FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CopyQueueTimestampQueriesSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CastingFullyTypedFormatSupported);
+FEATURE_SUPPORT_GET(D3D12_COMMAND_LIST_SUPPORT_FLAGS, m_dOptions3, WriteBufferImmediateSupportFlags);
+FEATURE_SUPPORT_GET(D3D12_VIEW_INSTANCING_TIER, m_dOptions3, ViewInstancingTier);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions3, BarycentricsSupported);
+
+// 22: Existing Heaps
+FEATURE_SUPPORT_GET_NAME(BOOL, m_dExistingHeaps, Supported, ExistingHeapsSupported);
+
+// 23: D3D12 Options4
+FEATURE_SUPPORT_GET(BOOL, m_dOptions4, MSAA64KBAlignedTextureSupported);
+FEATURE_SUPPORT_GET(D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER, m_dOptions4, SharedResourceCompatibilityTier);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions4, Native16BitShaderOpsSupported);
+
+// 24: Serialization
+FEATURE_SUPPORT_GET_NODE_INDEXED(D3D12_HEAP_SERIALIZATION_TIER, m_dSerialization, HeapSerializationTier);
+
+// 25: Cross Node
+// CrossNodeSharingTier handled in D3D12Options
+FEATURE_SUPPORT_GET_NAME(BOOL, m_dCrossNode, AtomicShaderInstructions, CrossNodeAtomicShaderInstructions);
+
+// 27: D3D12 Options5
+FEATURE_SUPPORT_GET(BOOL, m_dOptions5, SRVOnlyTiledResourceTier3);
+FEATURE_SUPPORT_GET(D3D12_RENDER_PASS_TIER, m_dOptions5, RenderPassesTier);
+FEATURE_SUPPORT_GET(D3D12_RAYTRACING_TIER, m_dOptions5, RaytracingTier);
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+// 28: Displayable
+FEATURE_SUPPORT_GET(BOOL, m_dDisplayable, DisplayableTexture);
+// SharedResourceCompatibilityTier handled in D3D12Options4
+#endif
+
+// 30: D3D12 Options6
+FEATURE_SUPPORT_GET(BOOL, m_dOptions6, AdditionalShadingRatesSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions6, PerPrimitiveShadingRateSupportedWithViewportIndexing);
+FEATURE_SUPPORT_GET(D3D12_VARIABLE_SHADING_RATE_TIER, m_dOptions6, VariableShadingRateTier);
+FEATURE_SUPPORT_GET(UINT, m_dOptions6, ShadingRateImageTileSize);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions6, BackgroundProcessingSupported);
+
+// 31: Query Meta Command
+// Keep the original call routine
+inline HRESULT CD3DX12FeatureSupport::QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const
+{
+ return m_pDevice->CheckFeatureSupport(D3D12_FEATURE_QUERY_META_COMMAND, &dQueryMetaCommand, sizeof(D3D12_FEATURE_DATA_QUERY_META_COMMAND));
+}
+
+// 32: D3D12 Options7
+FEATURE_SUPPORT_GET(D3D12_MESH_SHADER_TIER, m_dOptions7, MeshShaderTier);
+FEATURE_SUPPORT_GET(D3D12_SAMPLER_FEEDBACK_TIER, m_dOptions7, SamplerFeedbackTier);
+
+// 33: Protected Resource Session Type Count
+FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(UINT, m_dProtectedResourceSessionTypeCount, Count, ProtectedResourceSessionTypeCount);
+
+// 34: Protected Resource Session Types
+FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(std::vector<GUID>, m_dProtectedResourceSessionTypes, TypeVec, ProtectedResourceSessionTypes);
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+// 36: Options8
+FEATURE_SUPPORT_GET(BOOL, m_dOptions8, UnalignedBlockTexturesSupported);
+
+// 37: Options9
+FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderPipelineStatsSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderSupportsFullRangeRenderTargetArrayIndex);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnTypedResourceSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnGroupSharedSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions9, DerivativesInMeshAndAmplificationShadersSupported);
+FEATURE_SUPPORT_GET(D3D12_WAVE_MMA_TIER, m_dOptions9, WaveMMATier);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4)
+// 39: Options10
+FEATURE_SUPPORT_GET(BOOL, m_dOptions10, VariableRateShadingSumCombinerSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions10, MeshShaderPerPrimitiveShadingRateSupported);
+
+// 40: Options11
+FEATURE_SUPPORT_GET(BOOL, m_dOptions11, AtomicInt64OnDescriptorHeapResourceSupported);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 600)
+// 41: Options12
+FEATURE_SUPPORT_GET(D3D12_TRI_STATE, m_dOptions12, MSPrimitivesPipelineStatisticIncludesCulledPrimitives);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions12, EnhancedBarriersSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions12, RelaxedFormatCastingSupported);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 602)
+// 42: Options13
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedBufferTextureCopyPitchSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedVertexElementAlignmentSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportHeightFlipsYSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportDepthFlipsZSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, TextureCopyBetweenDimensionsSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions13, AlphaBlendFactorSupported);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+// 43: Options14
+FEATURE_SUPPORT_GET(BOOL, m_dOptions14, AdvancedTextureOpsSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions14, WriteableMSAATexturesSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions14, IndependentFrontAndBackStencilRefMaskSupported);
+
+// 44: Options15
+FEATURE_SUPPORT_GET(BOOL, m_dOptions15, TriangleFanSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions15, DynamicIndexBufferStripCutSupported);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+// 45: Options16
+FEATURE_SUPPORT_GET(BOOL, m_dOptions16, DynamicDepthBiasSupported);
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+FEATURE_SUPPORT_GET(BOOL, m_dOptions16, GPUUploadHeapSupported);
+
+// 46: Options17
+FEATURE_SUPPORT_GET(BOOL, m_dOptions17, NonNormalizedCoordinateSamplersSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions17, ManualWriteTrackingResourceSupported);
+
+// 47: Option18
+FEATURE_SUPPORT_GET(BOOL, m_dOptions18, RenderPassesValid);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+FEATURE_SUPPORT_GET(BOOL, m_dOptions19, MismatchingOutputDimensionsSupported);
+FEATURE_SUPPORT_GET(UINT, m_dOptions19, SupportedSampleCountsWithNoOutputs);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions19, PointSamplingAddressesNeverRoundUp);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions19, RasterizerDesc2Supported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions19, NarrowQuadrilateralLinesSupported);
+FEATURE_SUPPORT_GET(BOOL, m_dOptions19, AnisoFilterWithPointMipSupported);
+FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxSamplerDescriptorHeapSize);
+FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxSamplerDescriptorHeapSizeWithStaticSamplers);
+FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxViewDescriptorHeapSize);
+#endif
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611)
+// 49: Options20
+FEATURE_SUPPORT_GET(BOOL, m_dOptions20, ComputeOnlyWriteWatchSupported);
+#endif
+
+// Helper function to decide the highest shader model supported by the system
+// Stores the result in m_dShaderModel
+// Must be updated whenever a new shader model is added to the d3d12.h header
+inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel()
+{
+ // Check support in descending order
+ HRESULT result;
+
+ const D3D_SHADER_MODEL allModelVersions[] =
+ {
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ D3D_SHADER_MODEL_6_8,
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+ D3D_SHADER_MODEL_6_7,
+#endif
+ D3D_SHADER_MODEL_6_6,
+ D3D_SHADER_MODEL_6_5,
+ D3D_SHADER_MODEL_6_4,
+ D3D_SHADER_MODEL_6_3,
+ D3D_SHADER_MODEL_6_2,
+ D3D_SHADER_MODEL_6_1,
+ D3D_SHADER_MODEL_6_0,
+ D3D_SHADER_MODEL_5_1
+ };
+ constexpr size_t numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL);
+
+ for (size_t i = 0; i < numModelVersions; i++)
+ {
+ m_dShaderModel.HighestShaderModel = allModelVersions[i];
+ result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &m_dShaderModel, sizeof(D3D12_FEATURE_DATA_SHADER_MODEL));
+ if (result != E_INVALIDARG)
+ {
+ // Indicates that the version is recognizable by the runtime and stored in the struct
+ // Also terminate on unexpected error code
+ if (FAILED(result))
+ {
+ m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
+ }
+ return result;
+ }
+ }
+
+ // Shader model may not be supported. Continue the rest initializations
+ m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
+ return S_OK;
+}
+
+// Helper function to decide the highest root signature supported
+// Must be updated whenever a new root signature version is added to the d3d12.h header
+inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion()
+{
+ HRESULT result;
+
+ const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] =
+ {
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ D3D_ROOT_SIGNATURE_VERSION_1_2,
+#endif
+ D3D_ROOT_SIGNATURE_VERSION_1_1,
+ D3D_ROOT_SIGNATURE_VERSION_1_0,
+ D3D_ROOT_SIGNATURE_VERSION_1,
+ };
+ constexpr size_t numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION);
+
+ for (size_t i = 0; i < numRootSignatureVersions; i++)
+ {
+ m_dRootSignature.HighestVersion = allRootSignatureVersions[i];
+ result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE, &m_dRootSignature, sizeof(D3D12_FEATURE_DATA_ROOT_SIGNATURE));
+ if (result != E_INVALIDARG)
+ {
+ if (FAILED(result))
+ {
+ m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
+ }
+ // If succeeded, the highest version is already written into the member struct
+ return result;
+ }
+ }
+
+ // No version left. Set to invalid value and continue.
+ m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
+ return S_OK;
+}
+
+// Helper funcion to decide the highest feature level
+inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel()
+{
+ HRESULT result;
+
+ // Check against a list of all feature levels present in d3dcommon.h
+ // Needs to be updated for future feature levels
+ const D3D_FEATURE_LEVEL allLevels[] =
+ {
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3)
+ D3D_FEATURE_LEVEL_12_2,
+#endif
+ D3D_FEATURE_LEVEL_12_1,
+ D3D_FEATURE_LEVEL_12_0,
+ D3D_FEATURE_LEVEL_11_1,
+ D3D_FEATURE_LEVEL_11_0,
+ D3D_FEATURE_LEVEL_10_1,
+ D3D_FEATURE_LEVEL_10_0,
+ D3D_FEATURE_LEVEL_9_3,
+ D3D_FEATURE_LEVEL_9_2,
+ D3D_FEATURE_LEVEL_9_1,
+ D3D_FEATURE_LEVEL_1_0_CORE,
+ D3D_FEATURE_LEVEL_1_0_GENERIC
+ };
+
+ D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel;
+ dFeatureLevel.NumFeatureLevels = static_cast<UINT>(sizeof(allLevels) / sizeof(D3D_FEATURE_LEVEL));
+ dFeatureLevel.pFeatureLevelsRequested = allLevels;
+
+ result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, &dFeatureLevel, sizeof(D3D12_FEATURE_DATA_FEATURE_LEVELS));
+ if (SUCCEEDED(result))
+ {
+ m_eMaxFeatureLevel = dFeatureLevel.MaxSupportedFeatureLevel;
+ }
+ else
+ {
+ m_eMaxFeatureLevel = static_cast<D3D_FEATURE_LEVEL>(0);
+
+ if (result == DXGI_ERROR_UNSUPPORTED)
+ {
+ // Indicates that none supported. Continue initialization
+ result = S_OK;
+ }
+ }
+ return result;
+}
+
+// Helper function to initialize local protected resource session types structs
+inline HRESULT CD3DX12FeatureSupport::QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count)
+{
+ auto& CurrentPRSTypes = m_dProtectedResourceSessionTypes[NodeIndex];
+ CurrentPRSTypes.NodeIndex = NodeIndex;
+ CurrentPRSTypes.Count = Count;
+ CurrentPRSTypes.TypeVec.resize(CurrentPRSTypes.Count);
+ CurrentPRSTypes.pTypes = CurrentPRSTypes.TypeVec.data();
+
+ HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES, &m_dProtectedResourceSessionTypes[NodeIndex], sizeof(D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES));
+ if (FAILED(result))
+ {
+ // Resize TypeVec to empty
+ CurrentPRSTypes.TypeVec.clear();
+ }
+
+ return result;
+}
+
+#undef FEATURE_SUPPORT_GET
+#undef FEATURE_SUPPORT_GET_NAME
+#undef FEATURE_SUPPORT_GET_NODE_INDEXED
+#undef FEATURE_SUPPORT_GET_NODE_INDEXED_NAME
+
+// end CD3DX12FeatureSupport
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_core.h b/thirdparty/directx_headers/include/directx/d3dx12_core.h
new file mode 100644
index 0000000000..593f7637a3
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_core.h
@@ -0,0 +1,1535 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include <string.h>
+#include "d3d12.h"
+#include "d3dx12_default.h"
+
+//------------------------------------------------------------------------------------------------
+#ifndef D3DX12_ASSERT
+ #ifdef assert
+ #define D3DX12_ASSERT(x) assert(x)
+ #else
+ #define D3DX12_ASSERT(x)
+ #endif
+#endif
+
+//------------------------------------------------------------------------------------------------
+template <typename t_CommandListType>
+inline ID3D12CommandList * const * CommandListCast(t_CommandListType * const * pp) noexcept
+{
+ // 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);
+}
+
+//------------------------------------------------------------------------------------------------
+inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r ) noexcept
+{
+ 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 ) noexcept
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RECT : public D3D12_RECT
+{
+ CD3DX12_RECT() = default;
+ explicit CD3DX12_RECT( const D3D12_RECT& o ) noexcept :
+ D3D12_RECT( o )
+ {}
+ explicit CD3DX12_RECT(
+ LONG Left,
+ LONG Top,
+ LONG Right,
+ LONG Bottom ) noexcept
+ {
+ left = Left;
+ top = Top;
+ right = Right;
+ bottom = Bottom;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT
+{
+ CD3DX12_VIEWPORT() = default;
+ explicit CD3DX12_VIEWPORT( const D3D12_VIEWPORT& o ) noexcept :
+ D3D12_VIEWPORT( o )
+ {}
+ explicit CD3DX12_VIEWPORT(
+ FLOAT topLeftX,
+ FLOAT topLeftY,
+ FLOAT width,
+ FLOAT height,
+ FLOAT minDepth = D3D12_MIN_DEPTH,
+ FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept
+ {
+ 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 ) noexcept
+ {
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pResource->GetDesc(&tmpDesc);
+#endif
+ 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 = float(Desc.Width) - topLeftX;
+ Height = 1.0f;
+ break;
+ case D3D12_RESOURCE_DIMENSION_TEXTURE1D:
+ TopLeftX = topLeftX;
+ TopLeftY = 0.0f;
+ Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX;
+ Height = 1.0f;
+ break;
+ case D3D12_RESOURCE_DIMENSION_TEXTURE2D:
+ case D3D12_RESOURCE_DIMENSION_TEXTURE3D:
+ TopLeftX = topLeftX;
+ TopLeftY = topLeftY;
+ Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX;
+ Height = (SubresourceHeight ? float(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 ) noexcept :
+ D3D12_BOX( o )
+ {}
+ explicit CD3DX12_BOX(
+ LONG Left,
+ LONG Right ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+{
+ 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 ) noexcept
+{ 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 ) noexcept :
+ D3D12_DEPTH_STENCIL_DESC( o )
+ {}
+ explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept :
+ D3D12_DEPTH_STENCIL_DESC1( o )
+ {}
+ explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 noexcept
+ {
+ 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;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2
+{
+ CD3DX12_DEPTH_STENCIL_DESC2() = default;
+ explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC2& o ) noexcept :
+ D3D12_DEPTH_STENCIL_DESC2( o )
+ {}
+ explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept
+ {
+ DepthEnable = o.DepthEnable;
+ DepthWriteMask = o.DepthWriteMask;
+ DepthFunc = o.DepthFunc;
+ StencilEnable = o.StencilEnable;
+ FrontFace.StencilFailOp = o.FrontFace.StencilFailOp;
+ FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp;
+ FrontFace.StencilPassOp = o.FrontFace.StencilPassOp;
+ FrontFace.StencilFunc = o.FrontFace.StencilFunc;
+ FrontFace.StencilReadMask = o.StencilReadMask;
+ FrontFace.StencilWriteMask = o.StencilWriteMask;
+
+ BackFace.StencilFailOp = o.BackFace.StencilFailOp;
+ BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp;
+ BackFace.StencilPassOp = o.BackFace.StencilPassOp;
+ BackFace.StencilFunc = o.BackFace.StencilFunc;
+ BackFace.StencilReadMask = o.StencilReadMask;
+ BackFace.StencilWriteMask = o.StencilWriteMask;
+ DepthBoundsTestEnable = o.DepthBoundsTestEnable;
+ }
+ explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept
+ {
+ DepthEnable = o.DepthEnable;
+ DepthWriteMask = o.DepthWriteMask;
+ DepthFunc = o.DepthFunc;
+ StencilEnable = o.StencilEnable;
+
+ FrontFace.StencilFailOp = o.FrontFace.StencilFailOp;
+ FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp;
+ FrontFace.StencilPassOp = o.FrontFace.StencilPassOp;
+ FrontFace.StencilFunc = o.FrontFace.StencilFunc;
+ FrontFace.StencilReadMask = o.StencilReadMask;
+ FrontFace.StencilWriteMask = o.StencilWriteMask;
+
+ BackFace.StencilFailOp = o.BackFace.StencilFailOp;
+ BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp;
+ BackFace.StencilPassOp = o.BackFace.StencilPassOp;
+ BackFace.StencilFunc = o.BackFace.StencilFunc;
+ BackFace.StencilReadMask = o.StencilReadMask;
+ BackFace.StencilWriteMask = o.StencilWriteMask;
+
+ DepthBoundsTestEnable = FALSE;
+ }
+ explicit CD3DX12_DEPTH_STENCIL_DESC2( CD3DX12_DEFAULT ) noexcept
+ {
+ DepthEnable = TRUE;
+ DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
+ DepthFunc = D3D12_COMPARISON_FUNC_LESS;
+ StencilEnable = FALSE;
+ const D3D12_DEPTH_STENCILOP_DESC1 defaultStencilOp =
+ { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS, D3D12_DEFAULT_STENCIL_READ_MASK, D3D12_DEFAULT_STENCIL_WRITE_MASK };
+ FrontFace = defaultStencilOp;
+ BackFace = defaultStencilOp;
+ DepthBoundsTestEnable = FALSE;
+ }
+ explicit CD3DX12_DEPTH_STENCIL_DESC2(
+ BOOL depthEnable,
+ D3D12_DEPTH_WRITE_MASK depthWriteMask,
+ D3D12_COMPARISON_FUNC depthFunc,
+ BOOL stencilEnable,
+ D3D12_STENCIL_OP frontStencilFailOp,
+ D3D12_STENCIL_OP frontStencilDepthFailOp,
+ D3D12_STENCIL_OP frontStencilPassOp,
+ D3D12_COMPARISON_FUNC frontStencilFunc,
+ UINT8 frontStencilReadMask,
+ UINT8 frontStencilWriteMask,
+ D3D12_STENCIL_OP backStencilFailOp,
+ D3D12_STENCIL_OP backStencilDepthFailOp,
+ D3D12_STENCIL_OP backStencilPassOp,
+ D3D12_COMPARISON_FUNC backStencilFunc,
+ UINT8 backStencilReadMask,
+ UINT8 backStencilWriteMask,
+ BOOL depthBoundsTestEnable ) noexcept
+ {
+ DepthEnable = depthEnable;
+ DepthWriteMask = depthWriteMask;
+ DepthFunc = depthFunc;
+ StencilEnable = stencilEnable;
+
+ FrontFace.StencilFailOp = frontStencilFailOp;
+ FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
+ FrontFace.StencilPassOp = frontStencilPassOp;
+ FrontFace.StencilFunc = frontStencilFunc;
+ FrontFace.StencilReadMask = frontStencilReadMask;
+ FrontFace.StencilWriteMask = frontStencilWriteMask;
+
+ BackFace.StencilFailOp = backStencilFailOp;
+ BackFace.StencilDepthFailOp = backStencilDepthFailOp;
+ BackFace.StencilPassOp = backStencilPassOp;
+ BackFace.StencilFunc = backStencilFunc;
+ BackFace.StencilReadMask = backStencilReadMask;
+ BackFace.StencilWriteMask = backStencilWriteMask;
+
+ DepthBoundsTestEnable = depthBoundsTestEnable;
+ }
+
+ operator D3D12_DEPTH_STENCIL_DESC() const noexcept
+ {
+ D3D12_DEPTH_STENCIL_DESC D;
+ D.DepthEnable = DepthEnable;
+ D.DepthWriteMask = DepthWriteMask;
+ D.DepthFunc = DepthFunc;
+ D.StencilEnable = StencilEnable;
+ D.StencilReadMask = FrontFace.StencilReadMask;
+ D.StencilWriteMask = FrontFace.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;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 606
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC
+{
+ CD3DX12_BLEND_DESC() = default;
+ explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) noexcept :
+ D3D12_BLEND_DESC( o )
+ {}
+ explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT ) noexcept
+ {
+ 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 ) noexcept :
+ D3D12_RASTERIZER_DESC( o )
+ {}
+ explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT ) noexcept
+ {
+ 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) noexcept
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ MultisampleEnable = multisampleEnable;
+ AntialiasedLineEnable = antialiasedLineEnable;
+ ForcedSampleCount = forcedSampleCount;
+ ConservativeRaster = conservativeRaster;
+ }
+};
+
+
+//------------------------------------------------------------------------------------------------
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+struct CD3DX12_RASTERIZER_DESC1 : public D3D12_RASTERIZER_DESC1
+{
+ CD3DX12_RASTERIZER_DESC1() = default;
+ explicit CD3DX12_RASTERIZER_DESC1(const D3D12_RASTERIZER_DESC1& o) noexcept :
+ D3D12_RASTERIZER_DESC1(o)
+
+ {
+ }
+ explicit CD3DX12_RASTERIZER_DESC1(const D3D12_RASTERIZER_DESC& o) noexcept
+ {
+ FillMode = o.FillMode;
+ CullMode = o.CullMode;
+ FrontCounterClockwise = o.FrontCounterClockwise;
+ DepthBias = static_cast<FLOAT>(o.DepthBias);
+ DepthBiasClamp = o.DepthBiasClamp;
+ SlopeScaledDepthBias = o.SlopeScaledDepthBias;
+ DepthClipEnable = o.DepthClipEnable;
+ MultisampleEnable = o.MultisampleEnable;
+ AntialiasedLineEnable = o.AntialiasedLineEnable;
+ ForcedSampleCount = o.ForcedSampleCount;
+ ConservativeRaster = o.ConservativeRaster;
+ }
+ explicit CD3DX12_RASTERIZER_DESC1(CD3DX12_DEFAULT) noexcept
+ {
+ 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_DESC1(
+ D3D12_FILL_MODE fillMode,
+ D3D12_CULL_MODE cullMode,
+ BOOL frontCounterClockwise,
+ FLOAT depthBias,
+ FLOAT depthBiasClamp,
+ FLOAT slopeScaledDepthBias,
+ BOOL depthClipEnable,
+ BOOL multisampleEnable,
+ BOOL antialiasedLineEnable,
+ UINT forcedSampleCount,
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ MultisampleEnable = multisampleEnable;
+ AntialiasedLineEnable = antialiasedLineEnable;
+ ForcedSampleCount = forcedSampleCount;
+ ConservativeRaster = conservativeRaster;
+ }
+
+
+ operator D3D12_RASTERIZER_DESC() const noexcept
+ {
+ D3D12_RASTERIZER_DESC o;
+
+ o.FillMode = FillMode;
+ o.CullMode = CullMode;
+ o.FrontCounterClockwise = FrontCounterClockwise;
+ o.DepthBias = static_cast<INT>(DepthBias);
+ o.DepthBiasClamp = DepthBiasClamp;
+ o.SlopeScaledDepthBias = SlopeScaledDepthBias;
+ o.DepthClipEnable = DepthClipEnable;
+ o.MultisampleEnable = MultisampleEnable;
+ o.AntialiasedLineEnable = AntialiasedLineEnable;
+ o.ForcedSampleCount = ForcedSampleCount;
+ o.ConservativeRaster = ConservativeRaster;
+
+ return o;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 608
+
+//------------------------------------------------------------------------------------------------
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+struct CD3DX12_RASTERIZER_DESC2 : public D3D12_RASTERIZER_DESC2
+{
+ CD3DX12_RASTERIZER_DESC2() = default;
+ explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC2& o) noexcept :
+ D3D12_RASTERIZER_DESC2(o)
+
+ {
+ }
+ explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC1& o) noexcept
+ {
+ FillMode = o.FillMode;
+ CullMode = o.CullMode;
+ FrontCounterClockwise = o.FrontCounterClockwise;
+ DepthBias = o.DepthBias;
+ DepthBiasClamp = o.DepthBiasClamp;
+ SlopeScaledDepthBias = o.SlopeScaledDepthBias;
+ DepthClipEnable = o.DepthClipEnable;
+ LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED;
+ if (o.MultisampleEnable)
+ {
+ LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE;
+ }
+ else if (o.AntialiasedLineEnable)
+ {
+ LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED;
+ }
+ ForcedSampleCount = o.ForcedSampleCount;
+ ConservativeRaster = o.ConservativeRaster;
+ }
+ explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC& o) noexcept
+ : CD3DX12_RASTERIZER_DESC2(CD3DX12_RASTERIZER_DESC1(o))
+ {
+ }
+ explicit CD3DX12_RASTERIZER_DESC2(CD3DX12_DEFAULT) noexcept
+ {
+ 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;
+ LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED;
+ ForcedSampleCount = 0;
+ ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
+ }
+ explicit CD3DX12_RASTERIZER_DESC2(
+ D3D12_FILL_MODE fillMode,
+ D3D12_CULL_MODE cullMode,
+ BOOL frontCounterClockwise,
+ FLOAT depthBias,
+ FLOAT depthBiasClamp,
+ FLOAT slopeScaledDepthBias,
+ BOOL depthClipEnable,
+ D3D12_LINE_RASTERIZATION_MODE lineRasterizationMode,
+ UINT forcedSampleCount,
+ D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept
+ {
+ FillMode = fillMode;
+ CullMode = cullMode;
+ FrontCounterClockwise = frontCounterClockwise;
+ DepthBias = depthBias;
+ DepthBiasClamp = depthBiasClamp;
+ SlopeScaledDepthBias = slopeScaledDepthBias;
+ DepthClipEnable = depthClipEnable;
+ LineRasterizationMode = lineRasterizationMode;
+ ForcedSampleCount = forcedSampleCount;
+ ConservativeRaster = conservativeRaster;
+ }
+
+
+ operator D3D12_RASTERIZER_DESC1() const noexcept
+ {
+ D3D12_RASTERIZER_DESC1 o;
+
+ o.FillMode = FillMode;
+ o.CullMode = CullMode;
+ o.FrontCounterClockwise = FrontCounterClockwise;
+ o.DepthBias = DepthBias;
+ o.DepthBiasClamp = DepthBiasClamp;
+ o.SlopeScaledDepthBias = SlopeScaledDepthBias;
+ o.DepthClipEnable = DepthClipEnable;
+ o.MultisampleEnable = FALSE;
+ o.AntialiasedLineEnable = FALSE;
+ if (LineRasterizationMode == D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED)
+ {
+ o.AntialiasedLineEnable = TRUE;
+ }
+ else if (LineRasterizationMode != D3D12_LINE_RASTERIZATION_MODE_ALIASED)
+ {
+ o.MultisampleEnable = TRUE;
+ }
+ o.ForcedSampleCount = ForcedSampleCount;
+ o.ConservativeRaster = ConservativeRaster;
+
+ return o;
+ }
+ operator D3D12_RASTERIZER_DESC() const noexcept
+ {
+ return (D3D12_RASTERIZER_DESC)CD3DX12_RASTERIZER_DESC1((D3D12_RASTERIZER_DESC1)*this);
+ }
+};
+#endif // D3D12_SDK_VERSION >= 610
+
+//------------------------------------------------------------------------------------------------
+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 ) noexcept :
+ D3D12_RESOURCE_ALLOCATION_INFO( o )
+ {}
+ CD3DX12_RESOURCE_ALLOCATION_INFO(
+ UINT64 size,
+ UINT64 alignment ) noexcept
+ {
+ 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) noexcept :
+ D3D12_HEAP_PROPERTIES(o)
+ {}
+ CD3DX12_HEAP_PROPERTIES(
+ D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
+ D3D12_MEMORY_POOL memoryPoolPreference,
+ UINT creationNodeMask = 1,
+ UINT nodeMask = 1 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ Type = type;
+ CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
+ MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
+ CreationNodeMask = creationNodeMask;
+ VisibleNodeMask = nodeMask;
+ }
+ bool IsCPUAccessible() const noexcept
+ {
+ return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ || Type == D3D12_HEAP_TYPE_GPU_UPLOAD
+#endif
+ || (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 ) noexcept
+{
+ 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 ) noexcept
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
+{
+ CD3DX12_HEAP_DESC() = default;
+ explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) noexcept :
+ D3D12_HEAP_DESC(o)
+ {}
+ CD3DX12_HEAP_DESC(
+ UINT64 size,
+ D3D12_HEAP_PROPERTIES properties,
+ UINT64 alignment = 0,
+ D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ SizeInBytes = resAllocInfo.SizeInBytes;
+ Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
+ Alignment = resAllocInfo.Alignment;
+ Flags = flags;
+ }
+ bool IsCPUAccessible() const noexcept
+ { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
+};
+inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept
+{
+ 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 ) noexcept
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
+{
+ CD3DX12_CLEAR_VALUE() = default;
+ explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) noexcept :
+ D3D12_CLEAR_VALUE(o)
+ {}
+ CD3DX12_CLEAR_VALUE(
+ DXGI_FORMAT format,
+ const FLOAT color[4] ) noexcept
+ {
+ Format = format;
+ memcpy( Color, color, sizeof( Color ) );
+ }
+ CD3DX12_CLEAR_VALUE(
+ DXGI_FORMAT format,
+ FLOAT depth,
+ UINT8 stencil ) noexcept
+ {
+ Format = format;
+ memset( &Color, 0, sizeof( Color ) );
+ /* Use memcpy to preserve NAN values */
+ memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) );
+ DepthStencil.Stencil = stencil;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+inline bool operator==( const D3D12_CLEAR_VALUE &a, const D3D12_CLEAR_VALUE &b) noexcept
+{
+ if (a.Format != b.Format) return false;
+ if (a.Format == DXGI_FORMAT_D24_UNORM_S8_UINT
+ || a.Format == DXGI_FORMAT_D16_UNORM
+ || a.Format == DXGI_FORMAT_D32_FLOAT
+ || a.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT)
+ {
+ return (a.DepthStencil.Depth == b.DepthStencil.Depth) &&
+ (a.DepthStencil.Stencil == b.DepthStencil.Stencil);
+ } else {
+ return (a.Color[0] == b.Color[0]) &&
+ (a.Color[1] == b.Color[1]) &&
+ (a.Color[2] == b.Color[2]) &&
+ (a.Color[3] == b.Color[3]);
+ }
+}
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RANGE : public D3D12_RANGE
+{
+ CD3DX12_RANGE() = default;
+ explicit CD3DX12_RANGE(const D3D12_RANGE &o) noexcept :
+ D3D12_RANGE(o)
+ {}
+ CD3DX12_RANGE(
+ SIZE_T begin,
+ SIZE_T end ) noexcept
+ {
+ 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) noexcept :
+ D3D12_RANGE_UINT64(o)
+ {}
+ CD3DX12_RANGE_UINT64(
+ UINT64 begin,
+ UINT64 end ) noexcept
+ {
+ 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) noexcept :
+ D3D12_SUBRESOURCE_RANGE_UINT64(o)
+ {}
+ CD3DX12_SUBRESOURCE_RANGE_UINT64(
+ UINT subresource,
+ const D3D12_RANGE_UINT64& range ) noexcept
+ {
+ Subresource = subresource;
+ Range = range;
+ }
+ CD3DX12_SUBRESOURCE_RANGE_UINT64(
+ UINT subresource,
+ UINT64 begin,
+ UINT64 end ) noexcept
+ {
+ 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) noexcept :
+ D3D12_SHADER_BYTECODE(o)
+ {}
+ CD3DX12_SHADER_BYTECODE(
+ _In_ ID3DBlob* pShaderBlob ) noexcept
+ {
+ pShaderBytecode = pShaderBlob->GetBufferPointer();
+ BytecodeLength = pShaderBlob->GetBufferSize();
+ }
+ CD3DX12_SHADER_BYTECODE(
+ const void* _pShaderBytecode,
+ SIZE_T bytecodeLength ) noexcept
+ {
+ 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) noexcept :
+ D3D12_TILED_RESOURCE_COORDINATE(o)
+ {}
+ CD3DX12_TILED_RESOURCE_COORDINATE(
+ UINT x,
+ UINT y,
+ UINT z,
+ UINT subresource ) noexcept
+ {
+ 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) noexcept :
+ D3D12_TILE_REGION_SIZE(o)
+ {}
+ CD3DX12_TILE_REGION_SIZE(
+ UINT numTiles,
+ BOOL useBox,
+ UINT width,
+ UINT16 height,
+ UINT16 depth ) noexcept
+ {
+ 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) noexcept :
+ D3D12_SUBRESOURCE_TILING(o)
+ {}
+ CD3DX12_SUBRESOURCE_TILING(
+ UINT widthInTiles,
+ UINT16 heightInTiles,
+ UINT16 depthInTiles,
+ UINT startTileIndexInOverallResource ) noexcept
+ {
+ 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) noexcept :
+ D3D12_TILE_SHAPE(o)
+ {}
+ CD3DX12_TILE_SHAPE(
+ UINT widthInTexels,
+ UINT heightInTexels,
+ UINT depthInTexels ) noexcept
+ {
+ WidthInTexels = widthInTexels;
+ HeightInTexels = heightInTexels;
+ DepthInTexels = depthInTexels;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+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) noexcept :
+ D3D12_PACKED_MIP_INFO(o)
+ {}
+ CD3DX12_PACKED_MIP_INFO(
+ UINT8 numStandardMips,
+ UINT8 numPackedMips,
+ UINT numTilesForPackedMips,
+ UINT startTileIndexInOverallResource ) noexcept
+ {
+ 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) noexcept :
+ D3D12_SUBRESOURCE_FOOTPRINT(o)
+ {}
+ CD3DX12_SUBRESOURCE_FOOTPRINT(
+ DXGI_FORMAT format,
+ UINT width,
+ UINT height,
+ UINT depth,
+ UINT rowPitch ) noexcept
+ {
+ Format = format;
+ Width = width;
+ Height = height;
+ Depth = depth;
+ RowPitch = rowPitch;
+ }
+ explicit CD3DX12_SUBRESOURCE_FOOTPRINT(
+ const D3D12_RESOURCE_DESC& resDesc,
+ UINT rowPitch ) noexcept
+ {
+ Format = resDesc.Format;
+ Width = UINT( resDesc.Width );
+ Height = resDesc.Height;
+ Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u);
+ 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) noexcept :
+ D3D12_TEXTURE_COPY_LOCATION(o)
+ {}
+ CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes) noexcept
+ {
+ pResource = pRes;
+ Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ PlacedFootprint = {};
+ }
+ CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint) noexcept
+ {
+ pResource = pRes;
+ Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ PlacedFootprint = Footprint;
+ }
+ CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub) noexcept
+ {
+ pResource = pRes;
+ Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ PlacedFootprint = {};
+ SubresourceIndex = Sub;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept
+{
+ return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize;
+}
+
+//------------------------------------------------------------------------------------------------
+inline UINT8 D3D12GetFormatPlaneCount(
+ _In_ ID3D12Device* pDevice,
+ DXGI_FORMAT Format
+ ) noexcept
+{
+ 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 ) noexcept :
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth,
+ mipLevels, format, 1, 0, layout, flags );
+ }
+ inline UINT16 Depth() const noexcept
+ { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
+ inline UINT16 ArraySize() const noexcept
+ { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
+ inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept
+ { return D3D12GetFormatPlaneCount(pDevice, Format); }
+ inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept
+ { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); }
+ inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept
+ { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
+};
+inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept
+{
+ 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 ) noexcept
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
+{
+ CD3DX12_RESOURCE_DESC1() = default;
+ explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC1& o ) noexcept :
+ D3D12_RESOURCE_DESC1( o )
+ {}
+ explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC& o ) noexcept
+ {
+ Dimension = o.Dimension;
+ Alignment = o.Alignment;
+ Width = o.Width;
+ Height = o.Height;
+ DepthOrArraySize = o.DepthOrArraySize;
+ MipLevels = o.MipLevels;
+ Format = o.Format;
+ SampleDesc = o.SampleDesc;
+ Layout = o.Layout;
+ Flags = o.Flags;
+ SamplerFeedbackMipRegion = {};
+ }
+ 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) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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) noexcept
+ {
+ 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 ) noexcept
+ {
+ 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 noexcept
+ { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
+ inline UINT16 ArraySize() const noexcept
+ { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
+ inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept
+ { return D3D12GetFormatPlaneCount(pDevice, Format); }
+ inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept
+ { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); }
+ inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept
+ { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
+};
+inline bool operator==( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept
+{
+ 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 ) noexcept
+{ return !( l == r ); }
+
+//------------------------------------------------------------------------------------------------
+// Fills in the mipmap and alignment values of pDesc when either members are zero
+// Used to replace an implicit field to an explicit (0 mip map = max mip map level)
+// If expansion has occured, returns LclDesc, else returns the original pDesc
+inline const CD3DX12_RESOURCE_DESC1* D3DX12ConditionallyExpandAPIDesc(
+ CD3DX12_RESOURCE_DESC1& LclDesc,
+ const CD3DX12_RESOURCE_DESC1* pDesc)
+{
+ // Expand mip levels:
+ if (pDesc->MipLevels == 0 || pDesc->Alignment == 0)
+ {
+ LclDesc = *pDesc;
+ if (pDesc->MipLevels == 0)
+ {
+ auto MaxMipLevels = [](UINT64 uiMaxDimension) -> UINT16
+ {
+ UINT16 uiRet = 0;
+ while (uiMaxDimension > 0)
+ {
+ uiRet++;
+ uiMaxDimension >>= 1;
+ }
+ return uiRet;
+ };
+ auto Max = [](UINT64 const & a, UINT64 const & b)
+ {
+ return (a < b) ? b : a;
+ };
+
+ LclDesc.MipLevels = MaxMipLevels(
+ Max(LclDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? LclDesc.DepthOrArraySize : 1,
+ Max(LclDesc.Width, LclDesc.Height)));
+ }
+ if (pDesc->Alignment == 0)
+ {
+ if (pDesc->Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE
+ || pDesc->Layout == D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE
+ )
+ {
+ LclDesc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+ }
+ else
+ {
+ LclDesc.Alignment =
+ (pDesc->SampleDesc.Count > 1 ? D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT);
+ }
+ }
+ return &LclDesc;
+ }
+ else
+ {
+ return pDesc;
+ }
+}
+
+//------------------------------------------------------------------------------------------------
+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 ) noexcept :
+ D3D12_VIEW_INSTANCING_DESC( o )
+ {}
+ explicit CD3DX12_VIEW_INSTANCING_DESC( CD3DX12_DEFAULT ) noexcept
+ {
+ 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) noexcept
+ {
+ ViewInstanceCount = InViewInstanceCount;
+ pViewInstanceLocations = InViewInstanceLocations;
+ Flags = InFlags;
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+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) noexcept
+ : D3D12_RT_FORMAT_ARRAY(o)
+ {}
+ explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats) noexcept
+ {
+ NumRenderTargets = NumFormats;
+ memcpy(RTFormats, pFormats, sizeof(RTFormats));
+ // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats)
+ }
+}; \ No newline at end of file
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_default.h b/thirdparty/directx_headers/include/directx/d3dx12_default.h
new file mode 100644
index 0000000000..2b74d70f77
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_default.h
@@ -0,0 +1,12 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+struct CD3DX12_DEFAULT {};
+extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT;
+
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h
new file mode 100644
index 0000000000..b94073d38c
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h
@@ -0,0 +1,1411 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+#include "d3dx12_default.h"
+#include "d3dx12_core.h"
+
+//------------------------------------------------------------------------------------------------
+// Pipeline State Stream Helpers
+//------------------------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------------------------
+// Stream Subobjects, i.e. elements of a stream
+
+struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } };
+struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } };
+
+/* GODOT start */
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable : 4324)
+#endif
+/* GODOT start */
+template <typename InnerStructType, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type, typename DefaultArg = InnerStructType>
+class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT
+{
+private:
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE pssType;
+ InnerStructType pssInner;
+public:
+ CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT() noexcept : pssType(Type), pssInner(DefaultArg()) {}
+ CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT(InnerStructType const& i) noexcept : pssType(Type), pssInner(i) {}
+ CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT& operator=(InnerStructType const& i) noexcept { pssType = Type; pssInner = i; return *this; }
+ operator InnerStructType const&() const noexcept { return pssInner; }
+ operator InnerStructType&() noexcept { return pssInner; }
+ InnerStructType* operator&() noexcept { return &pssInner; }
+ InnerStructType const* operator&() const noexcept { return &pssInner; }
+};
+/* GODOT start */
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+/* GODOT end */
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INPUT_LAYOUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT> CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INDEX_BUFFER_STRIP_CUT_VALUE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE> CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PRIMITIVE_TOPOLOGY_TYPE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY> CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS> CD3DX12_PIPELINE_STATE_STREAM_VS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS> CD3DX12_PIPELINE_STATE_STREAM_GS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_STREAM_OUTPUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT> CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS> CD3DX12_PIPELINE_STATE_STREAM_HS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS> CD3DX12_PIPELINE_STATE_STREAM_DS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS> CD3DX12_PIPELINE_STATE_STREAM_PS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS> CD3DX12_PIPELINE_STATE_STREAM_AS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS> CD3DX12_PIPELINE_STATE_STREAM_MS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS> CD3DX12_PIPELINE_STATE_STREAM_CS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_BLEND_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2;
+#endif
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_FORMAT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER1;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER2;
+#endif
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_RT_FORMAT_ARRAY, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS> CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_SAMPLE_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, DefaultSampleDesc> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, DefaultSampleMask> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_CACHED_PIPELINE_STATE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO> CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO;
+typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_VIEW_INSTANCING_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING;
+
+//------------------------------------------------------------------------------------------------
+// Stream Parser Helpers
+
+struct ID3DX12PipelineParserCallbacks
+{
+ // Subobject Callbacks
+ virtual void FlagsCb(D3D12_PIPELINE_STATE_FLAGS) {}
+ virtual void NodeMaskCb(UINT) {}
+ virtual void RootSignatureCb(ID3D12RootSignature*) {}
+ virtual void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC&) {}
+ virtual void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE) {}
+ virtual void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE) {}
+ virtual void VSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void GSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC&) {}
+ virtual void HSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void DSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void PSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void CSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void ASCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void MSCb(const D3D12_SHADER_BYTECODE&) {}
+ virtual void BlendStateCb(const D3D12_BLEND_DESC&) {}
+ virtual void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC&) {}
+ virtual void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1&) {}
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ virtual void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2&) {}
+#endif
+ virtual void DSVFormatCb(DXGI_FORMAT) {}
+ virtual void RasterizerStateCb(const D3D12_RASTERIZER_DESC&) {}
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ virtual void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1&) {}
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+ virtual void RasterizerState2Cb(const D3D12_RASTERIZER_DESC2&) {}
+#endif
+ virtual void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY&) {}
+ virtual void SampleDescCb(const DXGI_SAMPLE_DESC&) {}
+ virtual void SampleMaskCb(UINT) {}
+ virtual void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC&) {}
+ virtual void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE&) {}
+
+ // Error Callbacks
+ virtual void ErrorBadInputParameter(UINT /*ParameterIndex*/) {}
+ virtual void ErrorDuplicateSubobject(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE /*DuplicateType*/) {}
+ virtual void ErrorUnknownSubobject(UINT /*UnknownTypeValue*/) {}
+
+ virtual ~ID3DX12PipelineParserCallbacks() = default;
+};
+
+struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC
+{
+ ID3D12RootSignature* pRootSignature;
+ D3D12_SHADER_BYTECODE AS;
+ D3D12_SHADER_BYTECODE MS;
+ D3D12_SHADER_BYTECODE PS;
+ D3D12_BLEND_DESC BlendState;
+ UINT SampleMask;
+ D3D12_RASTERIZER_DESC RasterizerState;
+ D3D12_DEPTH_STENCIL_DESC DepthStencilState;
+ D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
+ UINT NumRenderTargets;
+ DXGI_FORMAT RTVFormats[ D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ];
+ DXGI_FORMAT DSVFormat;
+ DXGI_SAMPLE_DESC SampleDesc;
+ UINT NodeMask;
+ D3D12_CACHED_PIPELINE_STATE CachedPSO;
+ D3D12_PIPELINE_STATE_FLAGS Flags;
+};
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+// Use CD3DX12_PIPELINE_STATE_STREAM5 for D3D12_RASTERIZER_DESC2 when CheckFeatureSupport returns true for Options19::RasterizerDesc2Supported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM4 for D3D12_RASTERIZER_DESC1 when CheckFeatureSupport returns true for Options16::DynamicDepthBiasSupported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline).
+// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
+// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
+struct CD3DX12_PIPELINE_STATE_STREAM5
+{
+ CD3DX12_PIPELINE_STATE_STREAM5() = default;
+ // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ CD3DX12_PIPELINE_STATE_STREAM5(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC2(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM5(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , PS(Desc.PS)
+ , AS(Desc.AS)
+ , MS(Desc.MS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC2(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM5(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(DepthStencilState).DepthEnable = false;
+ }
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_AS AS;
+ CD3DX12_PIPELINE_STATE_STREAM_MS MS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER2 RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = CD3DX12_RASTERIZER_DESC2(D3D12_RASTERIZER_DESC2(this->RasterizerState));
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 610
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+// Use CD3DX12_PIPELINE_STATE_STREAM4 for D3D12_RASTERIZER_DESC1 when CheckFeatureSupport returns true for Options16::DynamicDepthBiasSupported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline).
+// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
+// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
+struct CD3DX12_PIPELINE_STATE_STREAM4
+{
+ CD3DX12_PIPELINE_STATE_STREAM4() = default;
+ // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ CD3DX12_PIPELINE_STATE_STREAM4(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC1(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM4(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , PS(Desc.PS)
+ , AS(Desc.AS)
+ , MS(Desc.MS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC1(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM4(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(DepthStencilState).DepthEnable = false;
+ }
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_AS AS;
+ CD3DX12_PIPELINE_STATE_STREAM_MS MS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER1 RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = CD3DX12_RASTERIZER_DESC1(D3D12_RASTERIZER_DESC1(this->RasterizerState));
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 608
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true
+// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline).
+// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
+// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
+struct CD3DX12_PIPELINE_STATE_STREAM3
+{
+ CD3DX12_PIPELINE_STATE_STREAM3() = default;
+ // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM3(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , PS(Desc.PS)
+ , AS(Desc.AS)
+ , MS(Desc.MS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(DepthStencilState).DepthEnable = false;
+ }
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_AS AS;
+ CD3DX12_PIPELINE_STATE_STREAM_MS MS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = this->RasterizerState;
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+#endif // D3D12_SDK_VERSION >= 606
+
+// CD3DX12_PIPELINE_STATE_STREAM2 Works on OS Build 19041+ (where there is a new mesh shader pipeline).
+// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject).
+// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
+struct CD3DX12_PIPELINE_STATE_STREAM2
+{
+ CD3DX12_PIPELINE_STATE_STREAM2() = default;
+ // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM2(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , PS(Desc.PS)
+ , AS(Desc.AS)
+ , MS(Desc.MS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false;
+ }
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_AS AS;
+ CD3DX12_PIPELINE_STATE_STREAM_MS MS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = this->RasterizerState;
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+
+// CD3DX12_PIPELINE_STATE_STREAM1 Works on OS Build 16299+ (where there is a new view instancing subobject).
+// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support.
+struct CD3DX12_PIPELINE_STATE_STREAM1
+{
+ CD3DX12_PIPELINE_STATE_STREAM1() = default;
+ // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC
+ CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM1(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false;
+ }
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = this->RasterizerState;
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+
+
+struct CD3DX12_PIPELINE_MESH_STATE_STREAM
+{
+ CD3DX12_PIPELINE_MESH_STATE_STREAM() = default;
+ CD3DX12_PIPELINE_MESH_STATE_STREAM(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , PS(Desc.PS)
+ , AS(Desc.AS)
+ , MS(Desc.MS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT()))
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_AS AS;
+ CD3DX12_PIPELINE_STATE_STREAM_MS MS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc;
+ D3DX12_MESH_SHADER_PIPELINE_STATE_DESC MeshShaderDescV0() const noexcept
+ {
+ D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.PS = this->PS;
+ D.AS = this->AS;
+ D.MS = this->MS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = this->RasterizerState;
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+
+// CD3DX12_PIPELINE_STATE_STREAM works on OS Build 15063+ but does not support new subobject(s) added in OS Build 16299+.
+// See CD3DX12_PIPELINE_STATE_STREAM1 for instance.
+struct CD3DX12_PIPELINE_STATE_STREAM
+{
+ CD3DX12_PIPELINE_STATE_STREAM() = default;
+ CD3DX12_PIPELINE_STATE_STREAM(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , InputLayout(Desc.InputLayout)
+ , IBStripCutValue(Desc.IBStripCutValue)
+ , PrimitiveTopologyType(Desc.PrimitiveTopologyType)
+ , VS(Desc.VS)
+ , GS(Desc.GS)
+ , StreamOutput(Desc.StreamOutput)
+ , HS(Desc.HS)
+ , DS(Desc.DS)
+ , PS(Desc.PS)
+ , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState))
+ , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState))
+ , DSVFormat(Desc.DSVFormat)
+ , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState))
+ , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets))
+ , SampleDesc(Desc.SampleDesc)
+ , SampleMask(Desc.SampleMask)
+ , CachedPSO(Desc.CachedPSO)
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept
+ : Flags(Desc.Flags)
+ , NodeMask(Desc.NodeMask)
+ , pRootSignature(Desc.pRootSignature)
+ , CS(CD3DX12_SHADER_BYTECODE(Desc.CS))
+ , CachedPSO(Desc.CachedPSO)
+ {}
+ CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags;
+ CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask;
+ CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature;
+ CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout;
+ CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue;
+ CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType;
+ CD3DX12_PIPELINE_STATE_STREAM_VS VS;
+ CD3DX12_PIPELINE_STATE_STREAM_GS GS;
+ CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput;
+ CD3DX12_PIPELINE_STATE_STREAM_HS HS;
+ CD3DX12_PIPELINE_STATE_STREAM_DS DS;
+ CD3DX12_PIPELINE_STATE_STREAM_PS PS;
+ CD3DX12_PIPELINE_STATE_STREAM_CS CS;
+ CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState;
+ CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat;
+ CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState;
+ CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc;
+ CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask;
+ CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO;
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept
+ {
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.InputLayout = this->InputLayout;
+ D.IBStripCutValue = this->IBStripCutValue;
+ D.PrimitiveTopologyType = this->PrimitiveTopologyType;
+ D.VS = this->VS;
+ D.GS = this->GS;
+ D.StreamOutput = this->StreamOutput;
+ D.HS = this->HS;
+ D.DS = this->DS;
+ D.PS = this->PS;
+ D.BlendState = this->BlendState;
+ D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState));
+ D.DSVFormat = this->DSVFormat;
+ D.RasterizerState = this->RasterizerState;
+ D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets;
+ memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats));
+ D.SampleDesc = this->SampleDesc;
+ D.SampleMask = this->SampleMask;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+ D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept
+ {
+ D3D12_COMPUTE_PIPELINE_STATE_DESC D;
+ D.Flags = this->Flags;
+ D.NodeMask = this->NodeMask;
+ D.pRootSignature = this->pRootSignature;
+ D.CS = this->CS;
+ D.CachedPSO = this->CachedPSO;
+ return D;
+ }
+};
+
+struct CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
+{
+ CD3DX12_PIPELINE_STATE_STREAM2 PipelineStream;
+ CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER() noexcept
+ : SeenDSS(false)
+ {
+ // Adjust defaults to account for absent members.
+ PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
+
+ // Depth disabled if no DSV format specified.
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false;
+ }
+
+ // ID3DX12PipelineParserCallbacks
+ void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;}
+ void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;}
+ void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;}
+ void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;}
+ void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;}
+ void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;}
+ void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;}
+ void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;}
+ void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;}
+ void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;}
+ void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;}
+ void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;}
+ void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;}
+ void ASCb(const D3D12_SHADER_BYTECODE& AS) override {PipelineStream.AS = AS;}
+ void MSCb(const D3D12_SHADER_BYTECODE& MS) override {PipelineStream.MS = MS;}
+ void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);}
+ void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DSVFormatCb(DXGI_FORMAT DSVFormat) override
+ {
+ PipelineStream.DSVFormat = DSVFormat;
+ if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ // Re-enable depth for the default state.
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true;
+ }
+ }
+ void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);}
+ void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;}
+ void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;}
+ void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;}
+ void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);}
+ void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;}
+
+private:
+ bool SeenDSS;
+};
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
+{
+ CD3DX12_PIPELINE_STATE_STREAM3 PipelineStream;
+ CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER() noexcept
+ : SeenDSS(false)
+ {
+ // Adjust defaults to account for absent members.
+ PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
+
+ // Depth disabled if no DSV format specified.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = false;
+ }
+
+ // ID3DX12PipelineParserCallbacks
+ void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; }
+ void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; }
+ void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; }
+ void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; }
+ void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; }
+ void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; }
+ void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; }
+ void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; }
+ void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; }
+ void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; }
+ void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; }
+ void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; }
+ void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; }
+ void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; }
+ void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; }
+ void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); }
+ void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DSVFormatCb(DXGI_FORMAT DSVFormat) override
+ {
+ PipelineStream.DSVFormat = DSVFormat;
+ if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ // Re-enable depth for the default state.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = true;
+ }
+ }
+ void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState); }
+ void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; }
+ void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; }
+ void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; }
+ void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); }
+ void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; }
+
+private:
+ bool SeenDSS;
+};
+#endif // D3D12_SDK_VERSION >= 606
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+struct CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
+{
+ CD3DX12_PIPELINE_STATE_STREAM4 PipelineStream;
+ CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER() noexcept
+ : SeenDSS(false)
+ {
+ // Adjust defaults to account for absent members.
+ PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
+
+ // Depth disabled if no DSV format specified.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = false;
+ }
+
+ // ID3DX12PipelineParserCallbacks
+ void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; }
+ void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; }
+ void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; }
+ void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; }
+ void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; }
+ void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; }
+ void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; }
+ void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; }
+ void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; }
+ void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; }
+ void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; }
+ void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; }
+ void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; }
+ void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; }
+ void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; }
+ void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); }
+ void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DSVFormatCb(DXGI_FORMAT DSVFormat) override
+ {
+ PipelineStream.DSVFormat = DSVFormat;
+ if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ // Re-enable depth for the default state.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = true;
+ }
+ }
+ void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); }
+ void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); }
+ void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; }
+ void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; }
+ void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; }
+ void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); }
+ void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; }
+
+private:
+ bool SeenDSS;
+};
+#endif // D3D12_SDK_VERSION >= 608
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+struct CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
+{
+ CD3DX12_PIPELINE_STATE_STREAM5 PipelineStream;
+ CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER() noexcept
+ : SeenDSS(false)
+ {
+ // Adjust defaults to account for absent members.
+ PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
+
+ // Depth disabled if no DSV format specified.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = false;
+ }
+
+ // ID3DX12PipelineParserCallbacks
+ void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; }
+ void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; }
+ void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; }
+ void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; }
+ void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; }
+ void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; }
+ void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; }
+ void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; }
+ void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; }
+ void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; }
+ void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; }
+ void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; }
+ void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; }
+ void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; }
+ void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; }
+ void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); }
+ void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DSVFormatCb(DXGI_FORMAT DSVFormat) override
+ {
+ PipelineStream.DSVFormat = DSVFormat;
+ if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ // Re-enable depth for the default state.
+ static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = true;
+ }
+ }
+ void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); }
+ void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); }
+ void RasterizerState2Cb(const D3D12_RASTERIZER_DESC2& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); }
+ void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; }
+ void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; }
+ void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; }
+ void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); }
+ void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; }
+
+private:
+ bool SeenDSS;
+};
+#endif // D3D12_SDK_VERSION >= 610
+
+struct CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER : public ID3DX12PipelineParserCallbacks
+{
+ CD3DX12_PIPELINE_STATE_STREAM1 PipelineStream;
+ CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER() noexcept
+ : SeenDSS(false)
+ {
+ // Adjust defaults to account for absent members.
+ PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
+
+ // Depth disabled if no DSV format specified.
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false;
+ }
+
+ // ID3DX12PipelineParserCallbacks
+ void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;}
+ void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;}
+ void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;}
+ void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;}
+ void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;}
+ void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;}
+ void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;}
+ void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;}
+ void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;}
+ void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;}
+ void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;}
+ void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;}
+ void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;}
+ void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);}
+ void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override
+ {
+ PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState);
+ SeenDSS = true;
+ }
+ void DSVFormatCb(DXGI_FORMAT DSVFormat) override
+ {
+ PipelineStream.DSVFormat = DSVFormat;
+ if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ // Re-enable depth for the default state.
+ static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true;
+ }
+ }
+ void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);}
+ void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;}
+ void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;}
+ void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;}
+ void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);}
+ void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;}
+
+private:
+ bool SeenDSS;
+};
+
+inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE SubobjectType) noexcept
+{
+ switch (SubobjectType)
+ {
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1:
+ return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2:
+ return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1:
+ return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER;
+#endif
+ default:
+ return SubobjectType;
+ }
+}
+
+inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& Desc, ID3DX12PipelineParserCallbacks* pCallbacks)
+{
+ if (pCallbacks == nullptr)
+ {
+ return E_INVALIDARG;
+ }
+
+ if (Desc.SizeInBytes == 0 || Desc.pPipelineStateSubobjectStream == nullptr)
+ {
+ pCallbacks->ErrorBadInputParameter(1); // first parameter issue
+ return E_INVALIDARG;
+ }
+
+ bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {};
+ for (SIZE_T CurOffset = 0, SizeOfSubobject = 0; CurOffset < Desc.SizeInBytes; CurOffset += SizeOfSubobject)
+ {
+ BYTE* pStream = static_cast<BYTE*>(Desc.pPipelineStateSubobjectStream)+CurOffset;
+ auto SubobjectType = *reinterpret_cast<D3D12_PIPELINE_STATE_SUBOBJECT_TYPE*>(pStream);
+ if (SubobjectType < 0 || SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID)
+ {
+ pCallbacks->ErrorUnknownSubobject(SubobjectType);
+ return E_INVALIDARG;
+ }
+ if (SubobjectSeen[D3DX12GetBaseSubobjectType(SubobjectType)])
+ {
+ pCallbacks->ErrorDuplicateSubobject(SubobjectType);
+ return E_INVALIDARG; // disallow subobject duplicates in a stream
+ }
+ SubobjectSeen[SubobjectType] = true;
+ switch (SubobjectType)
+ {
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE:
+ pCallbacks->RootSignatureCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS:
+ pCallbacks->VSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::VS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::VS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS:
+ pCallbacks->PSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS:
+ pCallbacks->DSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS:
+ pCallbacks->HSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::HS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::HS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS:
+ pCallbacks->GSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::GS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::GS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS:
+ pCallbacks->CSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS:
+ pCallbacks->ASCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::AS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::AS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS:
+ pCallbacks->MSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::MS)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::MS);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT:
+ pCallbacks->StreamOutputCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND:
+ pCallbacks->BlendStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::BlendState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::BlendState);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK:
+ pCallbacks->SampleMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleMask)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleMask);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER:
+ pCallbacks->RasterizerStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState);
+ break;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608)
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1:
+ pCallbacks->RasterizerState1Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM4::RasterizerState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM4::RasterizerState);
+ break;
+#endif
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610)
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2:
+ pCallbacks->RasterizerState2Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM5::RasterizerState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM5::RasterizerState);
+ break;
+#endif
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL:
+ pCallbacks->DepthStencilStateCb(*reinterpret_cast<CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1:
+ pCallbacks->DepthStencilState1Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState);
+ break;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2:
+ pCallbacks->DepthStencilState2Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState);
+ break;
+#endif
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT:
+ pCallbacks->InputLayoutCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::InputLayout)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::InputLayout);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE:
+ pCallbacks->IBStripCutValueCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY:
+ pCallbacks->PrimitiveTopologyTypeCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS:
+ pCallbacks->RTVFormatsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT:
+ pCallbacks->DSVFormatCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC:
+ pCallbacks->SampleDescCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK:
+ pCallbacks->NodeMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::NodeMask)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::NodeMask);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO:
+ pCallbacks->CachedPSOCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS:
+ pCallbacks->FlagsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::Flags)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::Flags);
+ break;
+ case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING:
+ pCallbacks->ViewInstancingCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc)*>(pStream));
+ SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc);
+ break;
+ default:
+ pCallbacks->ErrorUnknownSubobject(SubobjectType);
+ return E_INVALIDARG;
+ }
+ }
+
+ return S_OK;
+}
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_property_format_table.h b/thirdparty/directx_headers/include/directx/d3dx12_property_format_table.h
new file mode 100644
index 0000000000..301100c034
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_property_format_table.h
@@ -0,0 +1,124 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+#ifndef __D3D12_PROPERTY_LAYOUT_FORMAT_TABLE_H__
+#define __D3D12_PROPERTY_LAYOUT_FORMAT_TABLE_H__
+#include "d3d12.h"
+#define MAP_ALIGN_REQUIREMENT 16 // Map is required to return 16-byte aligned addresses
+
+struct D3D12_PROPERTY_LAYOUT_FORMAT_TABLE
+{
+public:
+ // ----------------------------------------------------------------------------
+ // Information describing everything about a D3D Resource Format
+ // ----------------------------------------------------------------------------
+ typedef struct FORMAT_DETAIL
+ {
+ DXGI_FORMAT DXGIFormat;
+ DXGI_FORMAT ParentFormat;
+ const DXGI_FORMAT* pDefaultFormatCastSet; // This is dependent on FL/driver version, but is here to save a lot of space
+ UINT8 BitsPerComponent[4]; // only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE
+ UINT8 BitsPerUnit;
+ BYTE SRGBFormat : 1;
+ UINT WidthAlignment : 4; // number of texels to align to in a mip level.
+ UINT HeightAlignment : 4; // Top level dimensions must be a multiple of these
+ UINT DepthAlignment : 1; // values.
+ D3D_FORMAT_LAYOUT Layout : 1;
+ D3D_FORMAT_TYPE_LEVEL TypeLevel : 2;
+ D3D_FORMAT_COMPONENT_NAME ComponentName0 : 3; // RED ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE
+ D3D_FORMAT_COMPONENT_NAME ComponentName1 : 3; // GREEN ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE
+ D3D_FORMAT_COMPONENT_NAME ComponentName2 : 3; // BLUE ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE
+ D3D_FORMAT_COMPONENT_NAME ComponentName3 : 3; // ALPHA ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE
+ D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation0 : 3; // only used for D3DFTL_FULL_TYPE
+ D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation1 : 3; // only used for D3DFTL_FULL_TYPE
+ D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation2 : 3; // only used for D3DFTL_FULL_TYPE
+ D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation3 : 3; // only used for D3DFTL_FULL_TYPE
+ bool bDX9VertexOrIndexFormat : 1;
+ bool bDX9TextureFormat : 1;
+ bool bFloatNormFormat : 1;
+ bool bPlanar : 1;
+ bool bYUV : 1;
+ bool bDependantFormatCastSet : 1; // This indicates that the format cast set is dependent on FL/driver version
+ bool bInternal : 1;
+ } FORMAT_DETAIL;
+
+private:
+ static const FORMAT_DETAIL s_FormatDetail[];
+ static const UINT s_NumFormats;
+ static const LPCSTR s_FormatNames[]; // separate from above structure so it can be compiled out of runtime.
+public:
+ static UINT GetNumFormats();
+ static const FORMAT_DETAIL* GetFormatTable();
+ static D3D_FEATURE_LEVEL GetHighestDefinedFeatureLevel();
+
+ static DXGI_FORMAT GetFormat (SIZE_T Index);
+ static bool FormatExists (DXGI_FORMAT Format);
+ static bool FormatExistsInHeader (DXGI_FORMAT Format, bool bExternalHeader = true);
+ static UINT GetByteAlignment (DXGI_FORMAT Format);
+ static bool IsBlockCompressFormat (DXGI_FORMAT Format);
+ static LPCSTR GetName (DXGI_FORMAT Format, bool bHideInternalFormats = true);
+ static bool IsSRGBFormat (DXGI_FORMAT Format);
+ static UINT GetBitsPerStencil (DXGI_FORMAT Format);
+ static void GetFormatReturnTypes (DXGI_FORMAT Format, D3D_FORMAT_COMPONENT_INTERPRETATION* pInterpretations); // return array of 4 components
+ static UINT GetNumComponentsInFormat(DXGI_FORMAT Format);
+
+ // Converts the sequential component index (range from 0 to GetNumComponentsInFormat()) to
+ // the absolute component index (range 0 to 3).
+ static UINT Sequential2AbsoluteComponentIndex (DXGI_FORMAT Format, UINT SequentialComponentIndex);
+ static bool CanBeCastEvenFullyTyped (DXGI_FORMAT Format, D3D_FEATURE_LEVEL fl);
+ static UINT8 GetAddressingBitsPerAlignedSize (DXGI_FORMAT Format);
+ static DXGI_FORMAT GetParentFormat (DXGI_FORMAT Format);
+ static const DXGI_FORMAT* GetFormatCastSet (DXGI_FORMAT Format);
+ static D3D_FORMAT_LAYOUT GetLayout (DXGI_FORMAT Format);
+ static D3D_FORMAT_TYPE_LEVEL GetTypeLevel (DXGI_FORMAT Format);
+ static UINT GetBitsPerUnit (DXGI_FORMAT Format);
+ static UINT GetBitsPerUnitThrow (DXGI_FORMAT Format);
+ static UINT GetBitsPerElement (DXGI_FORMAT Format); // Legacy function used to support D3D10on9 only. Do not use.
+ static UINT GetWidthAlignment (DXGI_FORMAT Format);
+ static UINT GetHeightAlignment (DXGI_FORMAT Format);
+ static UINT GetDepthAlignment (DXGI_FORMAT Format);
+ static BOOL Planar (DXGI_FORMAT Format);
+ static BOOL NonOpaquePlanar (DXGI_FORMAT Format);
+ static BOOL YUV (DXGI_FORMAT Format);
+ static BOOL Opaque (DXGI_FORMAT Format);
+ static bool FamilySupportsStencil (DXGI_FORMAT Format);
+ static UINT NonOpaquePlaneCount (DXGI_FORMAT Format);
+ static BOOL DX9VertexOrIndexFormat (DXGI_FORMAT Format);
+ static BOOL DX9TextureFormat (DXGI_FORMAT Format);
+ static BOOL FloatNormTextureFormat (DXGI_FORMAT Format);
+ static bool DepthOnlyFormat (DXGI_FORMAT format);
+ static UINT8 GetPlaneCount (DXGI_FORMAT Format);
+ static bool MotionEstimatorAllowedInputFormat (DXGI_FORMAT Format);
+ static bool SupportsSamplerFeedback (DXGI_FORMAT Format);
+ static bool DecodeHistogramAllowedForOutputFormatSupport(DXGI_FORMAT Format);
+ static UINT8 GetPlaneSliceFromViewFormat (DXGI_FORMAT ResourceFormat, DXGI_FORMAT ViewFormat);
+ static bool FloatAndNotFloatFormats (DXGI_FORMAT FormatA, DXGI_FORMAT FormatB);
+ static bool SNORMAndUNORMFormats (DXGI_FORMAT FormatA, DXGI_FORMAT FormatB);
+ static bool ValidCastToR32UAV (DXGI_FORMAT from, DXGI_FORMAT to);
+ static bool IsSupportedTextureDisplayableFormat (DXGI_FORMAT, bool bMediaFormatOnly);
+ static D3D_FORMAT_COMPONENT_INTERPRETATION GetFormatComponentInterpretation (DXGI_FORMAT Format, UINT AbsoluteComponentIndex);
+ static UINT GetBitsPerComponent (DXGI_FORMAT Format, UINT AbsoluteComponentIndex);
+ static D3D_FORMAT_COMPONENT_NAME GetComponentName (DXGI_FORMAT Format, UINT AbsoluteComponentIndex);
+ static HRESULT CalculateExtraPlanarRows (DXGI_FORMAT format, UINT plane0Height, _Out_ UINT& totalHeight);
+ static HRESULT CalculateMinimumRowMajorRowPitch (DXGI_FORMAT Format, UINT Width, _Out_ UINT& RowPitch);
+ static HRESULT CalculateMinimumRowMajorSlicePitch (DXGI_FORMAT Format, UINT ContextBasedRowPitch, UINT Height, _Out_ UINT& SlicePitch);
+ static void GetYCbCrChromaSubsampling (DXGI_FORMAT Format, _Out_ UINT& HorizontalSubsampling, _Out_ UINT& VerticalSubsampling);
+
+ static HRESULT CalculateResourceSize (UINT width, UINT height, UINT depth, DXGI_FORMAT format, UINT mipLevels, UINT subresources, _Out_ SIZE_T& totalByteSize, _Out_writes_opt_(subresources) D3D12_MEMCPY_DEST* pDst = nullptr);
+ static void GetTileShape (D3D12_TILE_SHAPE* pTileShape, DXGI_FORMAT Format, D3D12_RESOURCE_DIMENSION Dimension, UINT SampleCount);
+ static void Get4KTileShape (D3D12_TILE_SHAPE* pTileShape, DXGI_FORMAT Format, D3D12_RESOURCE_DIMENSION Dimension, UINT SampleCount);
+ static void GetMipDimensions (UINT8 mipSlice, _Inout_ UINT64* pWidth, _Inout_opt_ UINT64* pHeight = nullptr, _Inout_opt_ UINT64* pDepth = nullptr);
+ static void GetPlaneSubsampledSizeAndFormatForCopyableLayout(UINT PlaneSlice, DXGI_FORMAT Format, UINT Width, UINT Height, _Out_ DXGI_FORMAT& PlaneFormat, _Out_ UINT& MinPlanePitchWidth, _Out_ UINT& PlaneWidth, _Out_ UINT& PlaneHeight);
+
+ static UINT GetDetailTableIndex (DXGI_FORMAT Format);
+ static UINT GetDetailTableIndexNoThrow (DXGI_FORMAT Format);
+ static UINT GetDetailTableIndexThrow (DXGI_FORMAT Format);
+private:
+ static const FORMAT_DETAIL* GetFormatDetail (DXGI_FORMAT Format);
+
+};
+
+#endif \ No newline at end of file
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_render_pass.h b/thirdparty/directx_headers/include/directx/d3dx12_render_pass.h
new file mode 100644
index 0000000000..fc032f86cd
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_render_pass.h
@@ -0,0 +1,102 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+inline bool operator==(const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept
+{
+ return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight));
+}
+
+inline bool operator==(const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept
+{
+ return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight));
+}
+
+inline bool operator==(const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept
+{
+ return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight));
+}
+#endif
+
+inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &b) noexcept
+{
+ return a.ClearValue == b.ClearValue;
+}
+
+inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &a, const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &b) noexcept
+{
+ if (a.pSrcResource != b.pSrcResource) return false;
+ if (a.pDstResource != b.pDstResource) return false;
+ if (a.SubresourceCount != b.SubresourceCount) return false;
+ if (a.Format != b.Format) return false;
+ if (a.ResolveMode != b.ResolveMode) return false;
+ if (a.PreserveResolveSource != b.PreserveResolveSource) return false;
+ return true;
+}
+
+inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS &b) noexcept
+{
+ if (a.Type != b.Type) return false;
+ switch (a.Type)
+ {
+ case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR:
+ if (!(a.Clear == b.Clear)) return false;
+ break;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER:
+ case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV:
+ case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_UAV:
+ if (!(a.PreserveLocal == b.PreserveLocal)) return false;
+ break;
+#endif
+ }
+ return true;
+}
+
+inline bool operator==(const D3D12_RENDER_PASS_ENDING_ACCESS& a, const D3D12_RENDER_PASS_ENDING_ACCESS& b) noexcept
+{
+ if (a.Type != b.Type) return false;
+ switch (a.Type)
+ {
+ case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE:
+ if (!(a.Resolve == b.Resolve)) return false;
+ break;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER:
+ case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV:
+ case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_UAV:
+ if (!(a.PreserveLocal == b.PreserveLocal)) return false;
+ break;
+#endif
+ }
+
+ return true;
+}
+
+inline bool operator==( const D3D12_RENDER_PASS_RENDER_TARGET_DESC &a, const D3D12_RENDER_PASS_RENDER_TARGET_DESC &b) noexcept
+{
+ if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false;
+ if (!(a.BeginningAccess == b.BeginningAccess)) return false;
+ if (!(a.EndingAccess == b.EndingAccess)) return false;
+ return true;
+}
+inline bool operator==( const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &a, const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &b) noexcept
+{
+ if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false;
+ if (!(a.DepthBeginningAccess == b.DepthBeginningAccess)) return false;
+ if (!(a.StencilBeginningAccess == b.StencilBeginningAccess)) return false;
+ if (!(a.DepthEndingAccess == b.DepthEndingAccess)) return false;
+ if (!(a.StencilEndingAccess == b.StencilEndingAccess)) return false;
+ return true;
+}
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_resource_helpers.h b/thirdparty/directx_headers/include/directx/d3dx12_resource_helpers.h
new file mode 100644
index 0000000000..902ec0cd6e
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_resource_helpers.h
@@ -0,0 +1,602 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+#include "d3dx12_core.h"
+#include "d3dx12_property_format_table.h"
+//------------------------------------------------------------------------------------------------
+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 ) noexcept
+{
+ MipSlice = static_cast<T>(Subresource % MipLevels);
+ ArraySlice = static_cast<U>((Subresource / MipLevels) % ArraySize);
+ PlaneSlice = static_cast<V>(Subresource / (MipLevels * ArraySize));
+}
+
+//------------------------------------------------------------------------------------------------
+// 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) noexcept
+{
+ for (UINT z = 0; z < NumSlices; ++z)
+ {
+ auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
+ auto pSrcSlice = static_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);
+ }
+ }
+}
+
+//------------------------------------------------------------------------------------------------
+// Row-by-row memcpy
+inline void MemcpySubresource(
+ _In_ const D3D12_MEMCPY_DEST* pDest,
+ _In_ const void* pResourceData,
+ _In_ const D3D12_SUBRESOURCE_INFO* pSrc,
+ SIZE_T RowSizeInBytes,
+ UINT NumRows,
+ UINT NumSlices) noexcept
+{
+ for (UINT z = 0; z < NumSlices; ++z)
+ {
+ auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
+ auto pSrcSlice = (static_cast<const BYTE*>(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * ULONG_PTR(z);
+ for (UINT y = 0; y < NumRows; ++y)
+ {
+ memcpy(pDestSlice + pDest->RowPitch * y,
+ pSrcSlice + pSrc->RowPitch * ULONG_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) noexcept
+{
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc);
+#endif
+ 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) noexcept
+{
+ // Minor validation
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto IntermediateDesc = pIntermediate->GetDesc();
+ const auto DestinationDesc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc1, tmpDesc2;
+ const auto& IntermediateDesc = *pIntermediate->GetDesc(&tmpDesc1);
+ const auto& DestinationDesc = *pDestinationResource->GetDesc(&tmpDesc2);
+#endif
+ 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)
+ {
+ const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
+ const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]);
+ pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr);
+ }
+ }
+ 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_ const void* pResourceData,
+ _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
+{
+ // Minor validation
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto IntermediateDesc = pIntermediate->GetDesc();
+ const auto DestinationDesc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc1, tmpDesc2;
+ const auto& IntermediateDesc = *pIntermediate->GetDesc(&tmpDesc1);
+ const auto& DestinationDesc = *pDestinationResource->GetDesc(&tmpDesc2);
+#endif
+ 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, pResourceData, &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)
+ {
+ const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
+ const 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) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
+{
+ UINT64 RequiredSize = 0;
+ const auto 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 = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
+ auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
+ auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
+
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc);
+#endif
+ ID3D12Device* pDevice = nullptr;
+ pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice));
+ pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
+ pDevice->Release();
+
+ const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
+ HeapFree(GetProcessHeap(), 0, pMem);
+ return Result;
+}
+
+//------------------------------------------------------------------------------------------------
+// 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_ const void* pResourceData,
+ _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
+{
+ UINT64 RequiredSize = 0;
+ const auto 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 = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
+ auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
+ auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
+
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc);
+#endif
+ ID3D12Device* pDevice = nullptr;
+ pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice));
+ pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
+ pDevice->Release();
+
+ const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, 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) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
+{
+ UINT64 RequiredSize = 0;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
+ UINT NumRows[MaxSubresources];
+ UINT64 RowSizesInBytes[MaxSubresources];
+
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc);
+#endif
+ 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);
+}
+
+//------------------------------------------------------------------------------------------------
+// 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_ const void* pResourceData,
+ _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
+{
+ UINT64 RequiredSize = 0;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
+ UINT NumRows[MaxSubresources];
+ UINT64 RowSizesInBytes[MaxSubresources];
+
+#if defined(_MSC_VER) || !defined(_WIN32)
+ const auto Desc = pDestinationResource->GetDesc();
+#else
+ D3D12_RESOURCE_DESC tmpDesc;
+ const auto& Desc = *pDestinationResource->GetDesc(&tmpDesc);
+#endif
+ 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, pResourceData, pSrcData);
+}
+
+//------------------------------------------------------------------------------------------------
+constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept
+{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; }
+
+//------------------------------------------------------------------------------------------------
+template< typename T >
+inline T D3DX12Align(T uValue, T uAlign)
+{
+ // Assert power of 2 alignment
+ D3DX12_ASSERT(0 == (uAlign & (uAlign - 1)));
+ T uMask = uAlign - 1;
+ T uResult = (uValue + uMask) & ~uMask;
+ D3DX12_ASSERT(uResult >= uValue);
+ D3DX12_ASSERT(0 == (uResult % uAlign));
+ return uResult;
+}
+
+//------------------------------------------------------------------------------------------------
+template< typename T >
+inline T D3DX12AlignAtLeast(T uValue, T uAlign)
+{
+ T aligned = D3DX12Align(uValue, uAlign);
+ return aligned > uAlign ? aligned : uAlign;
+}
+
+inline const CD3DX12_RESOURCE_DESC1* D3DX12ConditionallyExpandAPIDesc(
+ D3D12_RESOURCE_DESC1& LclDesc,
+ const D3D12_RESOURCE_DESC1* pDesc)
+{
+ return D3DX12ConditionallyExpandAPIDesc(static_cast<CD3DX12_RESOURCE_DESC1&>(LclDesc), static_cast<const CD3DX12_RESOURCE_DESC1*>(pDesc));
+}
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606)
+//------------------------------------------------------------------------------------------------
+// The difference between D3DX12GetCopyableFootprints and ID3D12Device::GetCopyableFootprints
+// is that this one loses a lot of error checking by assuming the arguments are correct
+inline bool D3DX12GetCopyableFootprints(
+ _In_ const D3D12_RESOURCE_DESC1& ResourceDesc,
+ _In_range_(0, D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0, D3D12_REQ_SUBRESOURCES - FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT* pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64* pRowSizeInBytes,
+ _Out_opt_ UINT64* pTotalBytes)
+{
+ constexpr UINT64 uint64_max = ~0ull;
+ UINT64 TotalBytes = uint64_max;
+ UINT uSubRes = 0;
+
+ bool bResourceOverflow = false;
+ TotalBytes = 0;
+
+ const DXGI_FORMAT Format = ResourceDesc.Format;
+
+ CD3DX12_RESOURCE_DESC1 LresourceDesc;
+ const CD3DX12_RESOURCE_DESC1& resourceDesc = *D3DX12ConditionallyExpandAPIDesc(LresourceDesc, &ResourceDesc);
+
+ // Check if its a valid format
+ D3DX12_ASSERT(D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FormatExists(Format));
+
+ const UINT WidthAlignment = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetWidthAlignment( Format );
+ const UINT HeightAlignment = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetHeightAlignment( Format );
+ const UINT16 DepthAlignment = UINT16( D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDepthAlignment( Format ) );
+
+ for (; uSubRes < NumSubresources; ++uSubRes)
+ {
+ bool bOverflow = false;
+ UINT Subresource = FirstSubresource + uSubRes;
+
+ D3DX12_ASSERT(resourceDesc.MipLevels != 0);
+ UINT subresourceCount = resourceDesc.MipLevels * resourceDesc.ArraySize() * D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneCount(resourceDesc.Format);
+
+ if (Subresource > subresourceCount)
+ {
+ break;
+ }
+
+ TotalBytes = D3DX12Align< UINT64 >( TotalBytes, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT );
+
+ UINT MipLevel, ArraySlice, PlaneSlice;
+ D3D12DecomposeSubresource(Subresource, resourceDesc.MipLevels, resourceDesc.ArraySize(), /*_Out_*/MipLevel, /*_Out_*/ArraySlice, /*_Out_*/PlaneSlice);
+
+ const UINT64 Width = D3DX12AlignAtLeast<UINT64>(resourceDesc.Width >> MipLevel, WidthAlignment);
+ const UINT Height = D3DX12AlignAtLeast(resourceDesc.Height >> MipLevel, HeightAlignment);
+ const UINT16 Depth = D3DX12AlignAtLeast<UINT16>(resourceDesc.Depth() >> MipLevel, DepthAlignment);
+
+ // Adjust for the current PlaneSlice. Most formats have only one plane.
+ DXGI_FORMAT PlaneFormat;
+ UINT32 MinPlanePitchWidth, PlaneWidth, PlaneHeight;
+ D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneSubsampledSizeAndFormatForCopyableLayout(PlaneSlice, Format, (UINT)Width, Height, /*_Out_*/ PlaneFormat, /*_Out_*/ MinPlanePitchWidth, /* _Out_ */ PlaneWidth, /*_Out_*/ PlaneHeight);
+
+ D3D12_SUBRESOURCE_FOOTPRINT LocalPlacement;
+ auto& Placement = pLayouts ? pLayouts[uSubRes].Footprint : LocalPlacement;
+ Placement.Format = PlaneFormat;
+ Placement.Width = PlaneWidth;
+ Placement.Height = PlaneHeight;
+ Placement.Depth = Depth;
+
+ // Calculate row pitch
+ UINT MinPlaneRowPitch = 0;
+ D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorRowPitch(PlaneFormat, MinPlanePitchWidth, MinPlaneRowPitch);
+
+ // Formats with more than one plane choose a larger pitch alignment to ensure that each plane begins on the row
+ // immediately following the previous plane while still adhering to subresource alignment restrictions.
+ static_assert( D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT >= D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
+ && ((D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT % D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) == 0),
+ "D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT must be >= and evenly divisible by D3D12_TEXTURE_DATA_PITCH_ALIGNMENT." );
+
+ Placement.RowPitch = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(Format)
+ ? D3DX12Align< UINT >( MinPlaneRowPitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT )
+ : D3DX12Align< UINT >( MinPlaneRowPitch, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT );
+
+ if (pRowSizeInBytes)
+ {
+ UINT PlaneRowSize = 0;
+ D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorRowPitch(PlaneFormat, PlaneWidth, PlaneRowSize);
+
+ pRowSizeInBytes[uSubRes] = PlaneRowSize;
+ }
+
+ // Number of rows (accounting for block compression and additional planes)
+ UINT NumRows = 0;
+ if (D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(Format))
+ {
+ NumRows = PlaneHeight;
+ }
+ else
+ {
+ D3DX12_ASSERT(Height % HeightAlignment == 0);
+ NumRows = Height / HeightAlignment;
+ }
+
+ if (pNumRows)
+ {
+ pNumRows[uSubRes] = NumRows;
+ }
+
+ // Offsetting
+ if (pLayouts)
+ {
+ pLayouts[uSubRes].Offset = (bOverflow ? uint64_max : TotalBytes + BaseOffset);
+ }
+
+ const UINT16 NumSlices = Depth;
+ const UINT64 SubresourceSize = (NumRows * NumSlices - 1) * Placement.RowPitch + MinPlaneRowPitch;
+
+ // uint64 addition with overflow checking
+ TotalBytes = TotalBytes + SubresourceSize;
+ if(TotalBytes < SubresourceSize)
+ {
+ TotalBytes = uint64_max;
+ }
+ bResourceOverflow = bResourceOverflow || bOverflow;
+ }
+
+ // Overflow error
+ if (bResourceOverflow)
+ {
+ TotalBytes = uint64_max;
+ }
+
+
+ if (pLayouts)
+ {
+ memset( pLayouts + uSubRes, -1, sizeof( *pLayouts ) * (NumSubresources - uSubRes) );
+ }
+ if (pNumRows)
+ {
+ memset(pNumRows + uSubRes, -1, sizeof(*pNumRows) * (NumSubresources - uSubRes));
+ }
+ if (pRowSizeInBytes)
+ {
+ memset(pRowSizeInBytes + uSubRes, -1, sizeof(*pRowSizeInBytes) * (NumSubresources - uSubRes));
+ }
+ if (pTotalBytes)
+ {
+ *pTotalBytes = TotalBytes;
+ }
+ if(TotalBytes == uint64_max)
+ {
+ return false;
+ }
+ return true;
+}
+
+//------------------------------------------------------------------------------------------------
+inline D3D12_RESOURCE_DESC1 D3DX12ResourceDesc0ToDesc1(D3D12_RESOURCE_DESC const& desc0)
+{
+ D3D12_RESOURCE_DESC1 desc1;
+ desc1.Dimension = desc0.Dimension;
+ desc1.Alignment = desc0.Alignment;
+ desc1.Width = desc0.Width;
+ desc1.Height = desc0.Height;
+ desc1.DepthOrArraySize = desc0.DepthOrArraySize;
+ desc1.MipLevels = desc0.MipLevels;
+ desc1.Format = desc0.Format;
+ desc1.SampleDesc.Count = desc0.SampleDesc.Count;
+ desc1.SampleDesc.Quality = desc0.SampleDesc.Quality;
+ desc1.Layout = desc0.Layout;
+ desc1.Flags = desc0.Flags;
+ desc1.SamplerFeedbackMipRegion.Width = 0;
+ desc1.SamplerFeedbackMipRegion.Height = 0;
+ desc1.SamplerFeedbackMipRegion.Depth = 0;
+ return desc1;
+}
+
+//------------------------------------------------------------------------------------------------
+inline bool D3DX12GetCopyableFootprints(
+ _In_ const D3D12_RESOURCE_DESC& pResourceDesc,
+ _In_range_(0, D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0, D3D12_REQ_SUBRESOURCES - FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT* pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64* pRowSizeInBytes,
+ _Out_opt_ UINT64* pTotalBytes)
+{
+ // From D3D12_RESOURCE_DESC to D3D12_RESOURCE_DESC1
+ D3D12_RESOURCE_DESC1 desc = D3DX12ResourceDesc0ToDesc1(pResourceDesc);
+ return D3DX12GetCopyableFootprints(
+ *static_cast<CD3DX12_RESOURCE_DESC1*>(&desc),// From D3D12_RESOURCE_DESC1 to CD3DX12_RESOURCE_DESC1
+ FirstSubresource,
+ NumSubresources,
+ BaseOffset,
+ pLayouts,
+ pNumRows,
+ pRowSizeInBytes,
+ pTotalBytes);
+}
+
+#endif // D3D12_SDK_VERSION >= 606
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h
new file mode 100644
index 0000000000..572efed852
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h
@@ -0,0 +1,1204 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+#include "d3dx12_default.h"
+
+//------------------------------------------------------------------------------------------------
+struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
+{
+ CD3DX12_DESCRIPTOR_RANGE() = default;
+ explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) noexcept :
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_ROOT_DESCRIPTOR_TABLE(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR_TABLE(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept
+ {
+ Init(numDescriptorRanges, _pDescriptorRanges);
+ }
+
+ inline void Init(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_ROOT_CONSTANTS(o)
+ {}
+ CD3DX12_ROOT_CONSTANTS(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0) noexcept
+ {
+ Init(num32BitValues, shaderRegister, registerSpace);
+ }
+
+ inline void Init(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0) noexcept
+ {
+ Init(*this, num32BitValues, shaderRegister, registerSpace);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_ROOT_CONSTANTS &rootConstants,
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0) noexcept
+ {
+ 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) noexcept :
+ D3D12_ROOT_DESCRIPTOR(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR(
+ UINT shaderRegister,
+ UINT registerSpace = 0) noexcept
+ {
+ Init(shaderRegister, registerSpace);
+ }
+
+ inline void Init(
+ UINT shaderRegister,
+ UINT registerSpace = 0) noexcept
+ {
+ Init(*this, shaderRegister, registerSpace);
+ }
+
+ static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0) noexcept
+ {
+ 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) noexcept :
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
+ }
+
+ inline void InitAsConstants(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
+ {
+ InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsConstantBufferView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
+ {
+ InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsShaderResourceView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
+ {
+ InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility);
+ }
+
+ inline void InitAsUnorderedAccessView(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
+ {
+ 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) noexcept :
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ Init(
+ *this,
+ shaderRegister,
+ filter,
+ addressU,
+ addressV,
+ addressW,
+ mipLODBias,
+ maxAnisotropy,
+ comparisonFunc,
+ borderColor,
+ minLOD,
+ maxLOD,
+ shaderVisibility,
+ registerSpace);
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+struct CD3DX12_STATIC_SAMPLER_DESC1 : public D3D12_STATIC_SAMPLER_DESC1
+{
+ CD3DX12_STATIC_SAMPLER_DESC1() = default;
+ explicit CD3DX12_STATIC_SAMPLER_DESC1(const D3D12_STATIC_SAMPLER_DESC &o) noexcept
+ {
+ memcpy(this, &o, sizeof(D3D12_STATIC_SAMPLER_DESC));
+ Flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE;
+ }
+ explicit CD3DX12_STATIC_SAMPLER_DESC1(const D3D12_STATIC_SAMPLER_DESC1 & o) noexcept :
+ D3D12_STATIC_SAMPLER_DESC1(o)
+ {}
+ CD3DX12_STATIC_SAMPLER_DESC1(
+ 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,
+ D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept
+ {
+ Init(
+ shaderRegister,
+ filter,
+ addressU,
+ addressV,
+ addressW,
+ mipLODBias,
+ maxAnisotropy,
+ comparisonFunc,
+ borderColor,
+ minLOD,
+ maxLOD,
+ shaderVisibility,
+ registerSpace,
+ flags);
+ }
+
+ static inline void Init(
+ _Out_ D3D12_STATIC_SAMPLER_DESC1 &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,
+ D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept
+ {
+ 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;
+ samplerDesc.Flags = flags;
+ }
+ 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,
+ D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept
+ {
+ Init(
+ *this,
+ shaderRegister,
+ filter,
+ addressU,
+ addressV,
+ addressW,
+ mipLODBias,
+ maxAnisotropy,
+ comparisonFunc,
+ borderColor,
+ minLOD,
+ maxLOD,
+ shaderVisibility,
+ registerSpace,
+ flags);
+ }
+};
+#endif // D3D12_SDK_VERSION >= 609
+
+//------------------------------------------------------------------------------------------------
+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) noexcept :
+ 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) noexcept
+ {
+ Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
+ }
+ CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_ROOT_DESCRIPTOR_TABLE1(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR_TABLE1(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept
+ {
+ Init(numDescriptorRanges, _pDescriptorRanges);
+ }
+
+ inline void Init(
+ UINT numDescriptorRanges,
+ _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_ROOT_DESCRIPTOR1(o)
+ {}
+ CD3DX12_ROOT_DESCRIPTOR1(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept
+ {
+ Init(shaderRegister, registerSpace, flags);
+ }
+
+ inline void Init(
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
+ }
+
+ inline void InitAsConstants(
+ UINT num32BitValues,
+ UINT shaderRegister,
+ UINT registerSpace = 0,
+ D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_VERSIONED_ROOT_SIGNATURE_DESC(o)
+ {}
+ explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept
+ {
+ Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
+ Desc_1_0 = o;
+ }
+ explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC1 &o) noexcept
+ {
+ Version = D3D_ROOT_SIGNATURE_VERSION_1_1;
+ Desc_1_1 = o;
+ }
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC2& o) noexcept
+ {
+ Version = D3D_ROOT_SIGNATURE_VERSION_1_2;
+ Desc_1_2 = o;
+ }
+#endif
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ Init_1_1(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
+ }
+ CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept
+ {
+ 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;
+ }
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ static inline void Init_1_2(
+ _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_DESC1* _pStaticSamplers = nullptr,
+ D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept
+ {
+ desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_2;
+ desc.Desc_1_2.NumParameters = numParameters;
+ desc.Desc_1_2.pParameters = _pParameters;
+ desc.Desc_1_2.NumStaticSamplers = numStaticSamplers;
+ desc.Desc_1_2.pStaticSamplers = _pStaticSamplers;
+ desc.Desc_1_2.Flags = flags;
+ }
+#endif
+};
+
+//------------------------------------------------------------------------------------------------
+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) noexcept :
+ D3D12_CPU_DESCRIPTOR_HANDLE(o)
+ {}
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept
+ {
+ InitOffsetted(other, offsetScaledByIncrementSize);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ ptr = SIZE_T(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
+ return *this;
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept
+ {
+ ptr = SIZE_T(INT64(ptr) + INT64(offsetScaledByIncrementSize));
+ return *this;
+ }
+ bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept
+ {
+ return (ptr == other.ptr);
+ }
+ bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept
+ {
+ return (ptr != other.ptr);
+ }
+ CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other) noexcept
+ {
+ ptr = other.ptr;
+ return *this;
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
+ {
+ InitOffsetted(*this, base, offsetScaledByIncrementSize);
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
+ {
+ 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) noexcept
+ {
+ 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) noexcept :
+ D3D12_GPU_DESCRIPTOR_HANDLE(o)
+ {}
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept
+ {
+ InitOffsetted(other, offsetScaledByIncrementSize);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ ptr = UINT64(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
+ return *this;
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept
+ {
+ ptr = UINT64(INT64(ptr) + INT64(offsetScaledByIncrementSize));
+ return *this;
+ }
+ inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept
+ {
+ return (ptr == other.ptr);
+ }
+ inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept
+ {
+ return (ptr != other.ptr);
+ }
+ CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other) noexcept
+ {
+ ptr = other.ptr;
+ return *this;
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
+ {
+ InitOffsetted(*this, base, offsetScaledByIncrementSize);
+ }
+
+ inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept
+ {
+ InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
+ }
+
+ static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept
+ {
+ 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) noexcept
+ {
+ handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize));
+ }
+};
+
+//------------------------------------------------------------------------------------------------
+// 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) noexcept
+{
+ 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:
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ case D3D_ROOT_SIGNATURE_VERSION_1_2:
+#endif
+ {
+ 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 = static_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 = static_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;
+ }
+ }
+ }
+
+ D3D12_STATIC_SAMPLER_DESC* pStaticSamplers = nullptr;
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ if (desc_1_1.NumStaticSamplers > 0 && pRootSignatureDesc->Version == D3D_ROOT_SIGNATURE_VERSION_1_2)
+ {
+ const SIZE_T SamplersSize = sizeof(D3D12_STATIC_SAMPLER_DESC) * desc_1_1.NumStaticSamplers;
+ pStaticSamplers = static_cast<D3D12_STATIC_SAMPLER_DESC*>(HeapAlloc(GetProcessHeap(), 0, SamplersSize));
+
+ if (pStaticSamplers == nullptr)
+ {
+ hr = E_OUTOFMEMORY;
+ }
+ else
+ {
+ const D3D12_ROOT_SIGNATURE_DESC2& desc_1_2 = pRootSignatureDesc->Desc_1_2;
+ for (UINT n = 0; n < desc_1_1.NumStaticSamplers; ++n)
+ {
+ if ((desc_1_2.pStaticSamplers[n].Flags & ~D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR) != 0)
+ {
+ hr = E_INVALIDARG;
+ break;
+ }
+ memcpy(pStaticSamplers + n, desc_1_2.pStaticSamplers + n, sizeof(D3D12_STATIC_SAMPLER_DESC));
+ }
+ }
+ }
+#endif
+
+ if (SUCCEEDED(hr))
+ {
+ const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : 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)
+ {
+ auto pDescriptorRanges_1_0 = pParameters_1_0[n].DescriptorTable.pDescriptorRanges;
+ HeapFree(GetProcessHeap(), 0, reinterpret_cast<void*>(const_cast<D3D12_DESCRIPTOR_RANGE*>(pDescriptorRanges_1_0)));
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, pParameters);
+ }
+
+ if (pStaticSamplers)
+ {
+ HeapFree(GetProcessHeap(), 0, pStaticSamplers);
+ }
+
+ return hr;
+ }
+ }
+ break;
+
+ case D3D_ROOT_SIGNATURE_VERSION_1_1:
+ switch (pRootSignatureDesc->Version)
+ {
+ case D3D_ROOT_SIGNATURE_VERSION_1_0:
+ case D3D_ROOT_SIGNATURE_VERSION_1_1:
+ return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
+
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ case D3D_ROOT_SIGNATURE_VERSION_1_2:
+ {
+ HRESULT hr = S_OK;
+ const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1;
+
+ D3D12_STATIC_SAMPLER_DESC* pStaticSamplers = nullptr;
+ if (desc_1_1.NumStaticSamplers > 0)
+ {
+ const SIZE_T SamplersSize = sizeof(D3D12_STATIC_SAMPLER_DESC) * desc_1_1.NumStaticSamplers;
+ pStaticSamplers = static_cast<D3D12_STATIC_SAMPLER_DESC*>(HeapAlloc(GetProcessHeap(), 0, SamplersSize));
+
+ if (pStaticSamplers == nullptr)
+ {
+ hr = E_OUTOFMEMORY;
+ }
+ else
+ {
+ const D3D12_ROOT_SIGNATURE_DESC2& desc_1_2 = pRootSignatureDesc->Desc_1_2;
+ for (UINT n = 0; n < desc_1_1.NumStaticSamplers; ++n)
+ {
+ if ((desc_1_2.pStaticSamplers[n].Flags & ~D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR) != 0)
+ {
+ hr = E_INVALIDARG;
+ break;
+ }
+ memcpy(pStaticSamplers + n, desc_1_2.pStaticSamplers + n, sizeof(D3D12_STATIC_SAMPLER_DESC));
+ }
+ }
+ }
+
+ if (SUCCEEDED(hr))
+ {
+ const CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC desc(desc_1_1.NumParameters, desc_1_1.pParameters, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags);
+ hr = D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob);
+ }
+
+ if (pStaticSamplers)
+ {
+ HeapFree(GetProcessHeap(), 0, pStaticSamplers);
+ }
+
+ return hr;
+ }
+#endif
+
+ }
+#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609)
+ case D3D_ROOT_SIGNATURE_VERSION_1_2:
+#endif
+ return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob);
+ }
+
+ return E_INVALIDARG;
+}
diff --git a/thirdparty/directx_headers/include/directx/d3dx12_state_object.h b/thirdparty/directx_headers/include/directx/d3dx12_state_object.h
new file mode 100644
index 0000000000..74dc6ca2d9
--- /dev/null
+++ b/thirdparty/directx_headers/include/directx/d3dx12_state_object.h
@@ -0,0 +1,790 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License (MIT).
+//
+//*********************************************************
+
+#pragma once
+
+#ifndef __cplusplus
+#error D3DX12 requires C++
+#endif
+
+#include "d3d12.h"
+
+//================================================================================================
+// D3DX12 State Object Creation Helpers
+//
+// Helper classes for creating new style state objects out of an arbitrary set of subobjects.
+// Uses STL
+//
+// Start by instantiating CD3DX12_STATE_OBJECT_DESC (see its public methods).
+// One of its methods is CreateSubobject(), which has a comment showing a couple of options for
+// defining subobjects using the helper classes for each subobject (CD3DX12_DXIL_LIBRARY_SUBOBJECT
+// etc.). The subobject helpers each have methods specific to the subobject for configuring its
+// contents.
+//
+//================================================================================================
+#include <list>
+#include <memory>
+#include <string>
+#include <vector>
+#ifndef D3DX12_USE_ATL
+#include <wrl/client.h>
+#define D3DX12_COM_PTR Microsoft::WRL::ComPtr
+#define D3DX12_COM_PTR_GET(x) x.Get()
+#define D3DX12_COM_PTR_ADDRESSOF(x) x.GetAddressOf()
+#else
+#include <atlbase.h>
+#define D3DX12_COM_PTR ATL::CComPtr
+#define D3DX12_COM_PTR_GET(x) x.p
+#define D3DX12_COM_PTR_ADDRESSOF(x) &x.p
+#endif
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_STATE_OBJECT_DESC
+{
+public:
+ CD3DX12_STATE_OBJECT_DESC() noexcept
+ {
+ Init(D3D12_STATE_OBJECT_TYPE_COLLECTION);
+ }
+ CD3DX12_STATE_OBJECT_DESC(D3D12_STATE_OBJECT_TYPE Type) noexcept
+ {
+ Init(Type);
+ }
+ void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) noexcept { m_Desc.Type = Type; }
+ operator const D3D12_STATE_OBJECT_DESC&()
+ {
+ // Do final preparation work
+ m_RepointedAssociations.clear();
+ m_SubobjectArray.clear();
+ m_SubobjectArray.reserve(m_Desc.NumSubobjects);
+ // Flatten subobjects into an array (each flattened subobject still has a
+ // member that's a pointer to its desc that's not flattened)
+ for (auto Iter = m_SubobjectList.begin();
+ Iter != m_SubobjectList.end(); Iter++)
+ {
+ m_SubobjectArray.push_back(*Iter);
+ // Store new location in array so we can redirect pointers contained in subobjects
+ Iter->pSubobjectArrayLocation = &m_SubobjectArray.back();
+ }
+ // For subobjects with pointer fields, create a new copy of those subobject definitions
+ // with fixed pointers
+ for (UINT i = 0; i < m_Desc.NumSubobjects; i++)
+ {
+ if (m_SubobjectArray[i].Type == D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION)
+ {
+ auto pOriginalSubobjectAssociation =
+ static_cast<const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION*>(m_SubobjectArray[i].pDesc);
+ D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION Repointed = *pOriginalSubobjectAssociation;
+ auto pWrapper =
+ static_cast<const SUBOBJECT_WRAPPER*>(pOriginalSubobjectAssociation->pSubobjectToAssociate);
+ Repointed.pSubobjectToAssociate = pWrapper->pSubobjectArrayLocation;
+ m_RepointedAssociations.push_back(Repointed);
+ m_SubobjectArray[i].pDesc = &m_RepointedAssociations.back();
+ }
+ }
+ // Below: using ugly way to get pointer in case .data() is not defined
+ m_Desc.pSubobjects = m_Desc.NumSubobjects ? &m_SubobjectArray[0] : nullptr;
+ return m_Desc;
+ }
+ operator const D3D12_STATE_OBJECT_DESC*()
+ {
+ // Cast calls the above final preparation work
+ return &static_cast<const D3D12_STATE_OBJECT_DESC&>(*this);
+ }
+
+ // CreateSubobject creates a sububject helper (e.g. CD3DX12_HIT_GROUP_SUBOBJECT)
+ // whose lifetime is owned by this class.
+ // e.g.
+ //
+ // CD3DX12_STATE_OBJECT_DESC Collection1(D3D12_STATE_OBJECT_TYPE_COLLECTION);
+ // auto Lib0 = Collection1.CreateSubobject<CD3DX12_DXIL_LIBRARY_SUBOBJECT>();
+ // Lib0->SetDXILLibrary(&pMyAppDxilLibs[0]);
+ // Lib0->DefineExport(L"rayGenShader0"); // in practice these export listings might be
+ // // data/engine driven
+ // etc.
+ //
+ // Alternatively, users can instantiate sububject helpers explicitly, such as via local
+ // variables instead, passing the state object desc that should point to it into the helper
+ // constructor (or call mySubobjectHelper.AddToStateObject(Collection1)).
+ // In this alternative scenario, the user must keep the subobject alive as long as the state
+ // object it is associated with is alive, else its pointer references will be stale.
+ // e.g.
+ //
+ // CD3DX12_STATE_OBJECT_DESC RaytracingState2(D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE);
+ // CD3DX12_DXIL_LIBRARY_SUBOBJECT LibA(RaytracingState2);
+ // LibA.SetDXILLibrary(&pMyAppDxilLibs[4]); // not manually specifying exports
+ // // - meaning all exports in the libraries
+ // // are exported
+ // etc.
+
+ template<typename T>
+ T* CreateSubobject()
+ {
+ T* pSubobject = new T(*this);
+ m_OwnedSubobjectHelpers.emplace_back(pSubobject);
+ return pSubobject;
+ }
+
+private:
+ D3D12_STATE_SUBOBJECT* TrackSubobject(D3D12_STATE_SUBOBJECT_TYPE Type, void* pDesc)
+ {
+ SUBOBJECT_WRAPPER Subobject;
+ Subobject.pSubobjectArrayLocation = nullptr;
+ Subobject.Type = Type;
+ Subobject.pDesc = pDesc;
+ m_SubobjectList.push_back(Subobject);
+ m_Desc.NumSubobjects++;
+ return &m_SubobjectList.back();
+ }
+ void Init(D3D12_STATE_OBJECT_TYPE Type) noexcept
+ {
+ SetStateObjectType(Type);
+ m_Desc.pSubobjects = nullptr;
+ m_Desc.NumSubobjects = 0;
+ m_SubobjectList.clear();
+ m_SubobjectArray.clear();
+ m_RepointedAssociations.clear();
+ }
+ typedef struct SUBOBJECT_WRAPPER : public D3D12_STATE_SUBOBJECT
+ {
+ D3D12_STATE_SUBOBJECT* pSubobjectArrayLocation; // new location when flattened into array
+ // for repointing pointers in subobjects
+ } SUBOBJECT_WRAPPER;
+ D3D12_STATE_OBJECT_DESC m_Desc;
+ std::list<SUBOBJECT_WRAPPER> m_SubobjectList; // Pointers to list nodes handed out so
+ // these can be edited live
+ std::vector<D3D12_STATE_SUBOBJECT> m_SubobjectArray; // Built at the end, copying list contents
+
+ std::list<D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION>
+ m_RepointedAssociations; // subobject type that contains pointers to other subobjects,
+ // repointed to flattened array
+
+ class StringContainer
+ {
+ public:
+ LPCWSTR LocalCopy(LPCWSTR string, bool bSingleString = false)
+ {
+ if (string)
+ {
+ if (bSingleString)
+ {
+ m_Strings.clear();
+ m_Strings.push_back(string);
+ }
+ else
+ {
+ m_Strings.push_back(string);
+ }
+ return m_Strings.back().c_str();
+ }
+ else
+ {
+ return nullptr;
+ }
+ }
+ void clear() noexcept { m_Strings.clear(); }
+ private:
+ std::list<std::wstring> m_Strings;
+ };
+
+ class SUBOBJECT_HELPER_BASE
+ {
+ public:
+ SUBOBJECT_HELPER_BASE() noexcept { Init(); }
+ virtual ~SUBOBJECT_HELPER_BASE() = default;
+ virtual D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept = 0;
+ void AddToStateObject(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ m_pSubobject = ContainingStateObject.TrackSubobject(Type(), Data());
+ }
+ protected:
+ virtual void* Data() noexcept = 0;
+ void Init() noexcept { m_pSubobject = nullptr; }
+ D3D12_STATE_SUBOBJECT* m_pSubobject;
+ };
+
+#if(__cplusplus >= 201103L)
+ std::list<std::unique_ptr<const SUBOBJECT_HELPER_BASE>> m_OwnedSubobjectHelpers;
+#else
+ class OWNED_HELPER
+ {
+ public:
+ OWNED_HELPER(const SUBOBJECT_HELPER_BASE* pHelper) noexcept { m_pHelper = pHelper; }
+ ~OWNED_HELPER() { delete m_pHelper; }
+ const SUBOBJECT_HELPER_BASE* m_pHelper;
+ };
+
+ std::list<OWNED_HELPER> m_OwnedSubobjectHelpers;
+#endif
+
+ friend class CD3DX12_DXIL_LIBRARY_SUBOBJECT;
+ friend class CD3DX12_EXISTING_COLLECTION_SUBOBJECT;
+ friend class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT;
+ friend class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
+ friend class CD3DX12_HIT_GROUP_SUBOBJECT;
+ friend class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT;
+ friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT;
+ friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT;
+ friend class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT;
+ friend class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT;
+ friend class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT;
+ friend class CD3DX12_NODE_MASK_SUBOBJECT;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_DXIL_LIBRARY_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_DXIL_LIBRARY_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_DXIL_LIBRARY_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetDXILLibrary(const D3D12_SHADER_BYTECODE* pCode) noexcept
+ {
+ static const D3D12_SHADER_BYTECODE Default = {};
+ m_Desc.DXILLibrary = pCode ? *pCode : Default;
+ }
+ void DefineExport(
+ LPCWSTR Name,
+ LPCWSTR ExportToRename = nullptr,
+ D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE)
+ {
+ D3D12_EXPORT_DESC Export;
+ Export.Name = m_Strings.LocalCopy(Name);
+ Export.ExportToRename = m_Strings.LocalCopy(ExportToRename);
+ Export.Flags = Flags;
+ m_Exports.push_back(Export);
+ m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
+ m_Desc.NumExports = static_cast<UINT>(m_Exports.size());
+ }
+ template<size_t N>
+ void DefineExports(LPCWSTR(&Exports)[N])
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ DefineExport(Exports[i]);
+ }
+ }
+ void DefineExports(const LPCWSTR* Exports, UINT N)
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ DefineExport(Exports[i]);
+ }
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_DXIL_LIBRARY_DESC&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ m_Strings.clear();
+ m_Exports.clear();
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_DXIL_LIBRARY_DESC m_Desc;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
+ std::vector<D3D12_EXPORT_DESC> m_Exports;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_EXISTING_COLLECTION_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_EXISTING_COLLECTION_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_EXISTING_COLLECTION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetExistingCollection(ID3D12StateObject*pExistingCollection) noexcept
+ {
+ m_Desc.pExistingCollection = pExistingCollection;
+ m_CollectionRef = pExistingCollection;
+ }
+ void DefineExport(
+ LPCWSTR Name,
+ LPCWSTR ExportToRename = nullptr,
+ D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE)
+ {
+ D3D12_EXPORT_DESC Export;
+ Export.Name = m_Strings.LocalCopy(Name);
+ Export.ExportToRename = m_Strings.LocalCopy(ExportToRename);
+ Export.Flags = Flags;
+ m_Exports.push_back(Export);
+ m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
+ m_Desc.NumExports = static_cast<UINT>(m_Exports.size());
+ }
+ template<size_t N>
+ void DefineExports(LPCWSTR(&Exports)[N])
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ DefineExport(Exports[i]);
+ }
+ }
+ void DefineExports(const LPCWSTR* Exports, UINT N)
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ DefineExport(Exports[i]);
+ }
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_EXISTING_COLLECTION_DESC&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ m_CollectionRef = nullptr;
+ m_Strings.clear();
+ m_Exports.clear();
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_EXISTING_COLLECTION_DESC m_Desc;
+ D3DX12_COM_PTR<ID3D12StateObject> m_CollectionRef;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
+ std::vector<D3D12_EXPORT_DESC> m_Exports;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAssociate) noexcept
+ {
+ m_Desc.pSubobjectToAssociate = &SubobjectToAssociate;
+ }
+ void AddExport(LPCWSTR Export)
+ {
+ m_Desc.NumExports++;
+ m_Exports.push_back(m_Strings.LocalCopy(Export));
+ m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
+ }
+ template<size_t N>
+ void AddExports(LPCWSTR (&Exports)[N])
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ AddExport(Exports[i]);
+ }
+ }
+ void AddExports(const LPCWSTR* Exports, UINT N)
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ AddExport(Exports[i]);
+ }
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ m_Strings.clear();
+ m_Exports.clear();
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
+ std::vector<LPCWSTR> m_Exports;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION() noexcept
+ {
+ Init();
+ }
+ CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate)
+ {
+ m_Desc.SubobjectToAssociate = m_SubobjectName.LocalCopy(SubobjectToAssociate, true);
+ }
+ void AddExport(LPCWSTR Export)
+ {
+ m_Desc.NumExports++;
+ m_Exports.push_back(m_Strings.LocalCopy(Export));
+ m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined
+ }
+ template<size_t N>
+ void AddExports(LPCWSTR (&Exports)[N])
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ AddExport(Exports[i]);
+ }
+ }
+ void AddExports(const LPCWSTR* Exports, UINT N)
+ {
+ for (UINT i = 0; i < N; i++)
+ {
+ AddExport(Exports[i]);
+ }
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ m_Strings.clear();
+ m_SubobjectName.clear();
+ m_Exports.clear();
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName;
+ std::vector<LPCWSTR> m_Exports;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_HIT_GROUP_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_HIT_GROUP_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_HIT_GROUP_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetHitGroupExport(LPCWSTR exportName)
+ {
+ m_Desc.HitGroupExport = m_Strings[0].LocalCopy(exportName, true);
+ }
+ void SetHitGroupType(D3D12_HIT_GROUP_TYPE Type) noexcept { m_Desc.Type = Type; }
+ void SetAnyHitShaderImport(LPCWSTR importName)
+ {
+ m_Desc.AnyHitShaderImport = m_Strings[1].LocalCopy(importName, true);
+ }
+ void SetClosestHitShaderImport(LPCWSTR importName)
+ {
+ m_Desc.ClosestHitShaderImport = m_Strings[2].LocalCopy(importName, true);
+ }
+ void SetIntersectionShaderImport(LPCWSTR importName)
+ {
+ m_Desc.IntersectionShaderImport = m_Strings[3].LocalCopy(importName, true);
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_HIT_GROUP_DESC&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ for (UINT i = 0; i < m_NumStrings; i++)
+ {
+ m_Strings[i].clear();
+ }
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_HIT_GROUP_DESC m_Desc;
+ static constexpr UINT m_NumStrings = 4;
+ CD3DX12_STATE_OBJECT_DESC::StringContainer
+ m_Strings[m_NumStrings]; // one string for every entrypoint name
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes) noexcept
+ {
+ m_Desc.MaxPayloadSizeInBytes = MaxPayloadSizeInBytes;
+ m_Desc.MaxAttributeSizeInBytes = MaxAttributeSizeInBytes;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_RAYTRACING_SHADER_CONFIG&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_RAYTRACING_SHADER_CONFIG m_Desc;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void Config(UINT MaxTraceRecursionDepth) noexcept
+ {
+ m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_RAYTRACING_PIPELINE_CONFIG&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_RAYTRACING_PIPELINE_CONFIG m_Desc;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS Flags) noexcept
+ {
+ m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth;
+ m_Desc.Flags = Flags;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_RAYTRACING_PIPELINE_CONFIG1&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_RAYTRACING_PIPELINE_CONFIG1 m_Desc;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept
+ {
+ m_pRootSig = pRootSig;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_pRootSig = nullptr;
+ }
+ void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); }
+ D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept
+ {
+ m_pRootSig = pRootSig;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_pRootSig = nullptr;
+ }
+ void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); }
+ D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags) noexcept
+ {
+ m_Desc.Flags = Flags;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_STATE_OBJECT_CONFIG&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_STATE_OBJECT_CONFIG m_Desc;
+};
+
+//------------------------------------------------------------------------------------------------
+class CD3DX12_NODE_MASK_SUBOBJECT
+ : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE
+{
+public:
+ CD3DX12_NODE_MASK_SUBOBJECT() noexcept
+ {
+ Init();
+ }
+ CD3DX12_NODE_MASK_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject)
+ {
+ Init();
+ AddToStateObject(ContainingStateObject);
+ }
+ void SetNodeMask(UINT NodeMask) noexcept
+ {
+ m_Desc.NodeMask = NodeMask;
+ }
+ D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override
+ {
+ return D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK;
+ }
+ operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; }
+ operator const D3D12_NODE_MASK&() const noexcept { return m_Desc; }
+private:
+ void Init() noexcept
+ {
+ SUBOBJECT_HELPER_BASE::Init();
+ m_Desc = {};
+ }
+ void* Data() noexcept override { return &m_Desc; }
+ D3D12_NODE_MASK m_Desc;
+};
+
+#undef D3DX12_COM_PTR
+#undef D3DX12_COM_PTR_GET
+#undef D3DX12_COM_PTR_ADDRESSOF
diff --git a/thirdparty/directx_headers/dxcore.h b/thirdparty/directx_headers/include/directx/dxcore.h
index 4244eaa60f..4244eaa60f 100644
--- a/thirdparty/directx_headers/dxcore.h
+++ b/thirdparty/directx_headers/include/directx/dxcore.h
diff --git a/thirdparty/directx_headers/dxcore_interface.h b/thirdparty/directx_headers/include/directx/dxcore_interface.h
index b487fe13fb..b487fe13fb 100644
--- a/thirdparty/directx_headers/dxcore_interface.h
+++ b/thirdparty/directx_headers/include/directx/dxcore_interface.h
diff --git a/thirdparty/directx_headers/dxgicommon.h b/thirdparty/directx_headers/include/directx/dxgicommon.h
index f83aa01e61..f83aa01e61 100644
--- a/thirdparty/directx_headers/dxgicommon.h
+++ b/thirdparty/directx_headers/include/directx/dxgicommon.h
diff --git a/thirdparty/directx_headers/dxgiformat.h b/thirdparty/directx_headers/include/directx/dxgiformat.h
index 52aae1b2be..83e6c07756 100644
--- a/thirdparty/directx_headers/dxgiformat.h
+++ b/thirdparty/directx_headers/include/directx/dxgiformat.h
@@ -135,6 +135,8 @@ typedef enum DXGI_FORMAT
DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189,
DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190,
+ DXGI_FORMAT_A4B4G4R4_UNORM = 191,
+
DXGI_FORMAT_FORCE_UINT = 0xffffffff
} DXGI_FORMAT;
diff --git a/thirdparty/directx_headers/include/dxguids/dxguids.h b/thirdparty/directx_headers/include/dxguids/dxguids.h
new file mode 100644
index 0000000000..b9a7b08fa7
--- /dev/null
+++ b/thirdparty/directx_headers/include/dxguids/dxguids.h
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#pragma once
+
+#ifndef __cplusplus
+#error "This header requires C++"
+#endif
+
+constexpr inline bool ConstexprIsEqualGUID(REFGUID a, REFGUID b)
+{
+ return a.Data1 == b.Data1 &&
+ a.Data2 == b.Data2 &&
+ a.Data3 == b.Data3 &&
+ a.Data4[0] == b.Data4[0] &&
+ a.Data4[1] == b.Data4[1] &&
+ a.Data4[2] == b.Data4[2] &&
+ a.Data4[3] == b.Data4[3] &&
+ a.Data4[4] == b.Data4[4] &&
+ a.Data4[5] == b.Data4[5] &&
+ a.Data4[6] == b.Data4[6] &&
+ a.Data4[7] == b.Data4[7];
+}
+
+template <typename T> GUID uuidof() = delete;
+template <typename T> GUID uuidof(T*) { return uuidof<T>(); }
+template <typename T> GUID uuidof(T**) { return uuidof<T>(); }
+template <typename T> GUID uuidof(T&) { return uuidof<T>(); }
+
+// Each COM interface (e.g. ID3D12Device) has a unique interface ID (IID) associated with it. With MSVC, the IID is defined
+// along with the interface declaration using compiler intrinsics (__declspec(uuid(...)); the IID can then be retrieved
+// using __uuidof. These intrinsics are not supported with all toolchains, so these helpers redefine IID values that can be
+// used with the various adapter COM helpers (ComPtr, IID_PPV_ARGS, etc.) for Linux. IIDs are stable and cannot change, but as
+// a precaution we statically assert the values are as expected when compiling for Windows.
+#if defined(_MSC_VER)
+#define _DXGUIDS_SUPPORT_STATIC_ASSERT_IID
+#elif defined(__CRT_UUID_DECL)
+/* match _mingw.h */
+#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
+#define _DXGUIDS_SUPPORT_STATIC_ASSERT_IID
+#endif /* __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L */
+#endif /* _MSC_VER */
+
+#ifdef _DXGUIDS_SUPPORT_STATIC_ASSERT_IID
+#define _WINADAPTER_ASSERT_IID(InterfaceName) \
+static_assert(ConstexprIsEqualGUID(uuidof<InterfaceName>(), __uuidof(InterfaceName)), "GUID definition mismatch: "#InterfaceName);
+#else
+#define _WINADAPTER_ASSERT_IID(InterfaceName)
+#endif
+
+#ifdef __CRT_UUID_DECL
+#define WINADAPTER_IID(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+template <> constexpr GUID uuidof<InterfaceName>() \
+{ \
+ return { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \
+} \
+__CRT_UUID_DECL(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+_WINADAPTER_ASSERT_IID(InterfaceName)
+#else
+#define WINADAPTER_IID(InterfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+template <> constexpr GUID uuidof<InterfaceName>() \
+{ \
+ return { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \
+} \
+_WINADAPTER_ASSERT_IID(InterfaceName)
+#endif /* defined(_WIN32) && defined(__MINGW32__) */
+
+// Direct3D
+#ifdef __d3d12_h__
+WINADAPTER_IID(ID3D12Object, 0xc4fec28f, 0x7966, 0x4e95, 0x9f, 0x94, 0xf4, 0x31, 0xcb, 0x56, 0xc3, 0xb8);
+WINADAPTER_IID(ID3D12DeviceChild, 0x905db94b, 0xa00c, 0x4140, 0x9d, 0xf5, 0x2b, 0x64, 0xca, 0x9e, 0xa3, 0x57);
+WINADAPTER_IID(ID3D12RootSignature, 0xc54a6b66, 0x72df, 0x4ee8, 0x8b, 0xe5, 0xa9, 0x46, 0xa1, 0x42, 0x92, 0x14);
+WINADAPTER_IID(ID3D12RootSignatureDeserializer, 0x34AB647B, 0x3CC8, 0x46AC, 0x84, 0x1B, 0xC0, 0x96, 0x56, 0x45, 0xC0, 0x46);
+WINADAPTER_IID(ID3D12VersionedRootSignatureDeserializer, 0x7F91CE67, 0x090C, 0x4BB7, 0xB7, 0x8E, 0xED, 0x8F, 0xF2, 0xE3, 0x1D, 0xA0);
+WINADAPTER_IID(ID3D12Pageable, 0x63ee58fb, 0x1268, 0x4835, 0x86, 0xda, 0xf0, 0x08, 0xce, 0x62, 0xf0, 0xd6);
+WINADAPTER_IID(ID3D12Heap, 0x6b3b2502, 0x6e51, 0x45b3, 0x90, 0xee, 0x98, 0x84, 0x26, 0x5e, 0x8d, 0xf3);
+WINADAPTER_IID(ID3D12Resource, 0x696442be, 0xa72e, 0x4059, 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad);
+WINADAPTER_IID(ID3D12CommandAllocator, 0x6102dee4, 0xaf59, 0x4b09, 0xb9, 0x99, 0xb4, 0x4d, 0x73, 0xf0, 0x9b, 0x24);
+WINADAPTER_IID(ID3D12Fence, 0x0a753dcf, 0xc4d8, 0x4b91, 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76);
+WINADAPTER_IID(ID3D12Fence1, 0x433685fe, 0xe22b, 0x4ca0, 0xa8, 0xdb, 0xb5, 0xb4, 0xf4, 0xdd, 0x0e, 0x4a);
+WINADAPTER_IID(ID3D12PipelineState, 0x765a30f3, 0xf624, 0x4c6f, 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45);
+WINADAPTER_IID(ID3D12DescriptorHeap, 0x8efb471d, 0x616c, 0x4f49, 0x90, 0xf7, 0x12, 0x7b, 0xb7, 0x63, 0xfa, 0x51);
+WINADAPTER_IID(ID3D12QueryHeap, 0x0d9658ae, 0xed45, 0x469e, 0xa6, 0x1d, 0x97, 0x0e, 0xc5, 0x83, 0xca, 0xb4);
+WINADAPTER_IID(ID3D12CommandSignature, 0xc36a797c, 0xec80, 0x4f0a, 0x89, 0x85, 0xa7, 0xb2, 0x47, 0x50, 0x82, 0xd1);
+WINADAPTER_IID(ID3D12CommandList, 0x7116d91c, 0xe7e4, 0x47ce, 0xb8, 0xc6, 0xec, 0x81, 0x68, 0xf4, 0x37, 0xe5);
+WINADAPTER_IID(ID3D12GraphicsCommandList, 0x5b160d0f, 0xac1b, 0x4185, 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55);
+WINADAPTER_IID(ID3D12GraphicsCommandList1, 0x553103fb, 0x1fe7, 0x4557, 0xbb, 0x38, 0x94, 0x6d, 0x7d, 0x0e, 0x7c, 0xa7);
+WINADAPTER_IID(ID3D12GraphicsCommandList2, 0x38C3E585, 0xFF17, 0x412C, 0x91, 0x50, 0x4F, 0xC6, 0xF9, 0xD7, 0x2A, 0x28);
+WINADAPTER_IID(ID3D12CommandQueue, 0x0ec870a6, 0x5d7e, 0x4c22, 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed);
+WINADAPTER_IID(ID3D12Device, 0x189819f1, 0x1db6, 0x4b57, 0xbe, 0x54, 0x18, 0x21, 0x33, 0x9b, 0x85, 0xf7);
+WINADAPTER_IID(ID3D12PipelineLibrary, 0xc64226a8, 0x9201, 0x46af, 0xb4, 0xcc, 0x53, 0xfb, 0x9f, 0xf7, 0x41, 0x4f);
+WINADAPTER_IID(ID3D12PipelineLibrary1, 0x80eabf42, 0x2568, 0x4e5e, 0xbd, 0x82, 0xc3, 0x7f, 0x86, 0x96, 0x1d, 0xc3);
+WINADAPTER_IID(ID3D12Device1, 0x77acce80, 0x638e, 0x4e65, 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e);
+WINADAPTER_IID(ID3D12Device2, 0x30baa41e, 0xb15b, 0x475c, 0xa0, 0xbb, 0x1a, 0xf5, 0xc5, 0xb6, 0x43, 0x28);
+WINADAPTER_IID(ID3D12Device3, 0x81dadc15, 0x2bad, 0x4392, 0x93, 0xc5, 0x10, 0x13, 0x45, 0xc4, 0xaa, 0x98);
+WINADAPTER_IID(ID3D12ProtectedSession, 0xA1533D18, 0x0AC1, 0x4084, 0x85, 0xB9, 0x89, 0xA9, 0x61, 0x16, 0x80, 0x6B);
+WINADAPTER_IID(ID3D12ProtectedResourceSession, 0x6CD696F4, 0xF289, 0x40CC, 0x80, 0x91, 0x5A, 0x6C, 0x0A, 0x09, 0x9C, 0x3D);
+WINADAPTER_IID(ID3D12Device4, 0xe865df17, 0xa9ee, 0x46f9, 0xa4, 0x63, 0x30, 0x98, 0x31, 0x5a, 0xa2, 0xe5);
+WINADAPTER_IID(ID3D12LifetimeOwner, 0xe667af9f, 0xcd56, 0x4f46, 0x83, 0xce, 0x03, 0x2e, 0x59, 0x5d, 0x70, 0xa8);
+WINADAPTER_IID(ID3D12SwapChainAssistant, 0xf1df64b6, 0x57fd, 0x49cd, 0x88, 0x07, 0xc0, 0xeb, 0x88, 0xb4, 0x5c, 0x8f);
+WINADAPTER_IID(ID3D12LifetimeTracker, 0x3fd03d36, 0x4eb1, 0x424a, 0xa5, 0x82, 0x49, 0x4e, 0xcb, 0x8b, 0xa8, 0x13);
+WINADAPTER_IID(ID3D12StateObject, 0x47016943, 0xfca8, 0x4594, 0x93, 0xea, 0xaf, 0x25, 0x8b, 0x55, 0x34, 0x6d);
+WINADAPTER_IID(ID3D12StateObjectProperties, 0xde5fa827, 0x9bf9, 0x4f26, 0x89, 0xff, 0xd7, 0xf5, 0x6f, 0xde, 0x38, 0x60);
+WINADAPTER_IID(ID3D12Device5, 0x8b4f173b, 0x2fea, 0x4b80, 0x8f, 0x58, 0x43, 0x07, 0x19, 0x1a, 0xb9, 0x5d);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings, 0x82BC481C, 0x6B9B, 0x4030, 0xAE, 0xDB, 0x7E, 0xE3, 0xD1, 0xDF, 0x1E, 0x63);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings1, 0xDBD5AE51, 0x3317, 0x4F0A, 0xAD, 0xF9, 0x1D, 0x7C, 0xED, 0xCA, 0xAE, 0x0B);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedDataSettings2, 0x61552388, 0x01ab, 0x4008, 0xa4, 0x36, 0x83, 0xdb, 0x18, 0x95, 0x66, 0xea);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedData, 0x98931D33, 0x5AE8, 0x4791, 0xAA, 0x3C, 0x1A, 0x73, 0xA2, 0x93, 0x4E, 0x71);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedData1, 0x9727A022, 0xCF1D, 0x4DDA, 0x9E, 0xBA, 0xEF, 0xFA, 0x65, 0x3F, 0xC5, 0x06);
+WINADAPTER_IID(ID3D12DeviceRemovedExtendedData2, 0x67FC5816, 0xE4CA, 0x4915, 0xBF, 0x18, 0x42, 0x54, 0x12, 0x72, 0xDA, 0x54);
+WINADAPTER_IID(ID3D12Device6, 0xc70b221b, 0x40e4, 0x4a17, 0x89, 0xaf, 0x02, 0x5a, 0x07, 0x27, 0xa6, 0xdc);
+WINADAPTER_IID(ID3D12ProtectedResourceSession1, 0xD6F12DD6, 0x76FB, 0x406E, 0x89, 0x61, 0x42, 0x96, 0xEE, 0xFC, 0x04, 0x09);
+WINADAPTER_IID(ID3D12Device7, 0x5c014b53, 0x68a1, 0x4b9b, 0x8b, 0xd1, 0xdd, 0x60, 0x46, 0xb9, 0x35, 0x8b);
+WINADAPTER_IID(ID3D12Device8, 0x9218E6BB, 0xF944, 0x4F7E, 0xA7, 0x5C, 0xB1, 0xB2, 0xC7, 0xB7, 0x01, 0xF3);
+WINADAPTER_IID(ID3D12Resource1, 0x9D5E227A, 0x4430, 0x4161, 0x88, 0xB3, 0x3E, 0xCA, 0x6B, 0xB1, 0x6E, 0x19);
+WINADAPTER_IID(ID3D12Resource2, 0xBE36EC3B, 0xEA85, 0x4AEB, 0xA4, 0x5A, 0xE9, 0xD7, 0x64, 0x04, 0xA4, 0x95);
+WINADAPTER_IID(ID3D12Heap1, 0x572F7389, 0x2168, 0x49E3, 0x96, 0x93, 0xD6, 0xDF, 0x58, 0x71, 0xBF, 0x6D);
+WINADAPTER_IID(ID3D12GraphicsCommandList3, 0x6FDA83A7, 0xB84C, 0x4E38, 0x9A, 0xC8, 0xC7, 0xBD, 0x22, 0x01, 0x6B, 0x3D);
+WINADAPTER_IID(ID3D12MetaCommand, 0xDBB84C27, 0x36CE, 0x4FC9, 0xB8, 0x01, 0xF0, 0x48, 0xC4, 0x6A, 0xC5, 0x70);
+WINADAPTER_IID(ID3D12GraphicsCommandList4, 0x8754318e, 0xd3a9, 0x4541, 0x98, 0xcf, 0x64, 0x5b, 0x50, 0xdc, 0x48, 0x74);
+WINADAPTER_IID(ID3D12ShaderCacheSession, 0x28e2495d, 0x0f64, 0x4ae4, 0xa6, 0xec, 0x12, 0x92, 0x55, 0xdc, 0x49, 0xa8);
+WINADAPTER_IID(ID3D12Device9, 0x4c80e962, 0xf032, 0x4f60, 0xbc, 0x9e, 0xeb, 0xc2, 0xcf, 0xa1, 0xd8, 0x3c);
+WINADAPTER_IID(ID3D12Device10, 0x517f8718, 0xaa66, 0x49f9, 0xb0, 0x2b, 0xa7, 0xab, 0x89, 0xc0, 0x60, 0x31);
+WINADAPTER_IID(ID3D12Device11, 0x5405c344, 0xd457, 0x444e, 0xb4, 0xdd, 0x23, 0x66, 0xe4, 0x5a, 0xee, 0x39);
+WINADAPTER_IID(ID3D12VirtualizationGuestDevice, 0xbc66d368, 0x7373, 0x4943, 0x87, 0x57, 0xfc, 0x87, 0xdc, 0x79, 0xe4, 0x76);
+WINADAPTER_IID(ID3D12Tools, 0x7071e1f0, 0xe84b, 0x4b33, 0x97, 0x4f, 0x12, 0xfa, 0x49, 0xde, 0x65, 0xc5);
+WINADAPTER_IID(ID3D12SDKConfiguration, 0xe9eb5314, 0x33aa, 0x42b2, 0xa7, 0x18, 0xd7, 0x7f, 0x58, 0xb1, 0xf1, 0xc7);
+WINADAPTER_IID(ID3D12SDKConfiguration1, 0x8aaf9303, 0xad25, 0x48b9, 0x9a, 0x57, 0xd9, 0xc3, 0x7e, 0x00, 0x9d, 0x9f);
+WINADAPTER_IID(ID3D12DeviceFactory, 0x61f307d3, 0xd34e, 0x4e7c, 0x83, 0x74, 0x3b, 0xa4, 0xde, 0x23, 0xcc, 0xcb);
+WINADAPTER_IID(ID3D12DeviceConfiguration, 0x78dbf87b, 0xf766, 0x422b, 0xa6, 0x1c, 0xc8, 0xc4, 0x46, 0xbd, 0xb9, 0xad);
+WINADAPTER_IID(ID3D12GraphicsCommandList5, 0x55050859, 0x4024, 0x474c, 0x87, 0xf5, 0x64, 0x72, 0xea, 0xee, 0x44, 0xea);
+WINADAPTER_IID(ID3D12GraphicsCommandList6, 0xc3827890, 0xe548, 0x4cfa, 0x96, 0xcf, 0x56, 0x89, 0xa9, 0x37, 0x0f, 0x80);
+WINADAPTER_IID(ID3D12GraphicsCommandList7, 0xdd171223, 0x8b61, 0x4769, 0x90, 0xe3, 0x16, 0x0c, 0xcd, 0xe4, 0xe2, 0xc1);
+WINADAPTER_IID(ID3D12GraphicsCommandList8, 0xee936ef9, 0x599d, 0x4d28, 0x93, 0x8e, 0x23, 0xc4, 0xad, 0x05, 0xce, 0x51);
+#endif
+
+// Direct3D Video
+#ifdef __d3d12video_h__
+WINADAPTER_IID(ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F);
+WINADAPTER_IID(ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4);
+WINADAPTER_IID(ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70);
+WINADAPTER_IID(ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38);
+WINADAPTER_IID(ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53);
+WINADAPTER_IID(ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09);
+WINADAPTER_IID(ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72);
+WINADAPTER_IID(ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67);
+WINADAPTER_IID(ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8);
+WINADAPTER_IID(ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05);
+WINADAPTER_IID(ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB);
+WINADAPTER_IID(ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23);
+WINADAPTER_IID(ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E);
+WINADAPTER_IID(ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26);
+WINADAPTER_IID(ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C);
+WINADAPTER_IID(ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4);
+WINADAPTER_IID(ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13);
+WINADAPTER_IID(ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29);
+WINADAPTER_IID(ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13);
+WINADAPTER_IID(ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4);
+WINADAPTER_IID(ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff);
+WINADAPTER_IID(ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc);
+WINADAPTER_IID(ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37);
+WINADAPTER_IID(ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A);
+WINADAPTER_IID(ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44);
+WINADAPTER_IID(ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a);
+WINADAPTER_IID(ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76);
+#endif
+
+#ifdef __d3d12sdklayers_h__
+WINADAPTER_IID(ID3D12Debug, 0x344488b7, 0x6846, 0x474b, 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0);
+WINADAPTER_IID(ID3D12Debug1, 0xaffaa4ca, 0x63fe, 0x4d8e, 0xb8, 0xad, 0x15, 0x90, 0x00, 0xaf, 0x43, 0x04);
+WINADAPTER_IID(ID3D12Debug2, 0x93a665c4, 0xa3b2, 0x4e5d, 0xb6, 0x92, 0xa2, 0x6a, 0xe1, 0x4e, 0x33, 0x74);
+WINADAPTER_IID(ID3D12Debug3, 0x5cf4e58f, 0xf671, 0x4ff1, 0xa5, 0x42, 0x36, 0x86, 0xe3, 0xd1, 0x53, 0xd1);
+WINADAPTER_IID(ID3D12Debug4, 0x014b816e, 0x9ec5, 0x4a2f, 0xa8, 0x45, 0xff, 0xbe, 0x44, 0x1c, 0xe1, 0x3a);
+WINADAPTER_IID(ID3D12Debug5, 0x548d6b12, 0x09fa, 0x40e0, 0x90, 0x69, 0x5d, 0xcd, 0x58, 0x9a, 0x52, 0xc9);
+WINADAPTER_IID(ID3D12Debug6, 0x82a816d6, 0x5d01, 0x4157, 0x97, 0xd0, 0x49, 0x75, 0x46, 0x3f, 0xd1, 0xed);
+WINADAPTER_IID(ID3D12DebugDevice1, 0xa9b71770, 0xd099, 0x4a65, 0xa6, 0x98, 0x3d, 0xee, 0x10, 0x02, 0x0f, 0x88);
+WINADAPTER_IID(ID3D12DebugDevice, 0x3febd6dd, 0x4973, 0x4787, 0x81, 0x94, 0xe4, 0x5f, 0x9e, 0x28, 0x92, 0x3e);
+WINADAPTER_IID(ID3D12DebugDevice2, 0x60eccbc1, 0x378d, 0x4df1, 0x89, 0x4c, 0xf8, 0xac, 0x5c, 0xe4, 0xd7, 0xdd);
+WINADAPTER_IID(ID3D12DebugCommandQueue, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3a);
+WINADAPTER_IID(ID3D12DebugCommandQueue1, 0x16be35a2, 0xbfd6, 0x49f2, 0xbc, 0xae, 0xea, 0xae, 0x4a, 0xff, 0x86, 0x2d);
+WINADAPTER_IID(ID3D12DebugCommandList1, 0x102ca951, 0x311b, 0x4b01, 0xb1, 0x1f, 0xec, 0xb8, 0x3e, 0x06, 0x1b, 0x37);
+WINADAPTER_IID(ID3D12DebugCommandList, 0x09e0bf36, 0x54ac, 0x484f, 0x88, 0x47, 0x4b, 0xae, 0xea, 0xb6, 0x05, 0x3f);
+WINADAPTER_IID(ID3D12DebugCommandList2, 0xaeb575cf, 0x4e06, 0x48be, 0xba, 0x3b, 0xc4, 0x50, 0xfc, 0x96, 0x65, 0x2e);
+WINADAPTER_IID(ID3D12DebugCommandList3, 0x197d5e15, 0x4d37, 0x4d34, 0xaf, 0x78, 0x72, 0x4c, 0xd7, 0x0f, 0xdb, 0x1f);
+WINADAPTER_IID(ID3D12SharingContract, 0x0adf7d52, 0x929c, 0x4e61, 0xad, 0xdb, 0xff, 0xed, 0x30, 0xde, 0x66, 0xef);
+WINADAPTER_IID(ID3D12InfoQueue, 0x0742a90b, 0xc387, 0x483f, 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58);
+WINADAPTER_IID(ID3D12InfoQueue1, 0x2852dd88, 0xb484, 0x4c0c, 0xb6, 0xb1, 0x67, 0x16, 0x85, 0x00, 0xe6, 0x00);
+#endif
+
+// DXCore
+#ifdef __dxcore_interface_h__
+WINADAPTER_IID(IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06);
+WINADAPTER_IID(IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28);
+WINADAPTER_IID(IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e);
+#endif