diff --git a/DirectXTex/d3dx12.h b/DirectXTex/d3dx12.h index 4c838fd..8218340 100644 --- a/DirectXTex/d3dx12.h +++ b/DirectXTex/d3dx12.h @@ -315,7 +315,7 @@ struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1 }; //------------------------------------------------------------------------------------------------ -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2 { CD3DX12_DEPTH_STENCIL_DESC2() = default; @@ -439,7 +439,7 @@ struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2 return D; } }; -#endif // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#endif // D3D12_SDK_VERSION >= 606 //------------------------------------------------------------------------------------------------ struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC @@ -514,7 +514,7 @@ struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC }; //------------------------------------------------------------------------------------------------ -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) struct CD3DX12_RASTERIZER_DESC1 : public D3D12_RASTERIZER_DESC1 { CD3DX12_RASTERIZER_DESC1() = default; @@ -597,7 +597,113 @@ struct CD3DX12_RASTERIZER_DESC1 : public D3D12_RASTERIZER_DESC1 return o; } }; -#endif // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#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 @@ -648,6 +754,9 @@ struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES 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)); } @@ -977,8 +1086,8 @@ struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER return result; } static inline CD3DX12_RESOURCE_BARRIER Aliasing( - _In_ ID3D12Resource* pResourceBefore, - _In_ ID3D12Resource* pResourceAfter) noexcept + _In_opt_ ID3D12Resource* pResourceBefore, + _In_opt_ ID3D12Resource* pResourceAfter) noexcept { CD3DX12_RESOURCE_BARRIER result = {}; D3D12_RESOURCE_BARRIER &barrier = result; @@ -988,7 +1097,7 @@ struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER return result; } static inline CD3DX12_RESOURCE_BARRIER UAV( - _In_ ID3D12Resource* pResource) noexcept + _In_opt_ ID3D12Resource* pResource) noexcept { CD3DX12_RESOURCE_BARRIER result = {}; D3D12_RESOURCE_BARRIER &barrier = result; @@ -1426,6 +1535,120 @@ struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC }; +//------------------------------------------------------------------------------------------------ +#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 { @@ -1718,6 +1941,13 @@ struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNA 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, @@ -1792,6 +2022,23 @@ struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNA 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 }; //------------------------------------------------------------------------------------------------ @@ -2611,7 +2858,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); case D3D_ROOT_SIGNATURE_VERSION_1_1: -#if defined(NTDDI_WIN10_CU) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: #endif { @@ -2704,7 +2951,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( break; case D3D_ROOT_SIGNATURE_VERSION_1_1: -#if defined(NTDDI_WIN10_CU) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: #endif return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); @@ -2774,14 +3021,17 @@ typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, 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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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; @@ -2812,13 +3062,16 @@ struct ID3DX12PipelineParserCallbacks 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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) - virtual void RasterizerState2Cb(const D3D12_RASTERIZER_DESC1&) {} +#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&) {} @@ -2854,7 +3107,132 @@ struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D3D12_PIPELINE_STATE_FLAGS Flags; }; -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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(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). @@ -2976,8 +3354,9 @@ struct CD3DX12_PIPELINE_STATE_STREAM4 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). @@ -3098,7 +3477,7 @@ struct CD3DX12_PIPELINE_STATE_STREAM3 return D; } }; -#endif // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#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). @@ -3544,7 +3923,7 @@ private: bool SeenDSS; }; -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParserCallbacks { CD3DX12_PIPELINE_STATE_STREAM3 PipelineStream; @@ -3609,7 +3988,9 @@ struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParse 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; @@ -3665,7 +4046,7 @@ struct CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER : public ID3DX12PipelineParse } } void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); } - void RasterizerState2Cb(const D3D12_RASTERIZER_DESC1& 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; } @@ -3675,7 +4056,76 @@ struct CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER : public ID3DX12PipelineParse private: bool SeenDSS; }; -#endif // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#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(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(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 { @@ -3741,9 +4191,11 @@ inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3D12_PIPE { case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1: return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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 @@ -3835,11 +4287,17 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& pCallbacks->RasterizerStateCb(*reinterpret_cast(pStream)); SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState); break; -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1: - pCallbacks->RasterizerState2Cb(*reinterpret_cast(pStream)); + pCallbacks->RasterizerState1Cb(*reinterpret_cast(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(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM5::RasterizerState); + break; #endif case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL: pCallbacks->DepthStencilStateCb(*reinterpret_cast(pStream)); @@ -3849,7 +4307,7 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& pCallbacks->DepthStencilState1Cb(*reinterpret_cast(pStream)); SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState); break; -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2: pCallbacks->DepthStencilState2Cb(*reinterpret_cast(pStream)); SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState); @@ -3905,10 +4363,28 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& } //------------------------------------------------------------------------------------------------ +#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; @@ -3919,18 +4395,64 @@ inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS if (a.PreserveResolveSource != b.PreserveResolveSource) return false; return true; } + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4062) +#endif + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch" +#endif + 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; + 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 + +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; + 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; } + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + 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; @@ -4726,7 +5248,7 @@ private: #endif // !D3DX12_NO_STATE_OBJECT_HELPERS -#if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) //================================================================================================ // D3DX12 Enhanced Barrier Helpers @@ -4853,7 +5375,7 @@ public: } }; -#endif // NTDDI_WIN10_NI || USING_D3D12_AGILITY_SDK +#endif // D3D12_SDK_VERSION >= 608 #ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS @@ -4969,7 +5491,7 @@ public: // Function declaration D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept; D3D12_RAYTRACING_TIER RaytracingTier() const noexcept; -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) // DISPLAYABLE BOOL DisplayableTexture() const noexcept; // SharedResourceCompatibilityTier handled in D3D12Options4 @@ -4995,7 +5517,7 @@ public: // Function declaration // PROTECTED_RESOURCE_SESSION_TYPES std::vector ProtectedResourceSessionTypes(UINT NodeIndex = 0) const; -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3) // D3D12_OPTIONS8 BOOL UnalignedBlockTexturesSupported() const noexcept; @@ -5008,7 +5530,7 @@ public: // Function declaration D3D12_WAVE_MMA_TIER WaveMMATier() const noexcept; #endif -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) // D3D12_OPTIONS10 BOOL VariableRateShadingSumCombinerSupported() const noexcept; BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept; @@ -5017,12 +5539,14 @@ public: // Function declaration BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept; #endif -#if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#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; @@ -5032,7 +5556,7 @@ public: // Function declaration BOOL AlphaBlendFactorSupported() const noexcept; #endif -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) // D3D12_OPTIONS14 BOOL AdvancedTextureOpsSupported() const noexcept; BOOL WriteableMSAATexturesSupported() const noexcept; @@ -5041,11 +5565,36 @@ public: // Function declaration // 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 + private: // Private structs and helpers declaration struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES { @@ -5092,30 +5641,43 @@ private: // Member data std::vector m_dSerialization; // Cat2 NodeIndex D3D12_FEATURE_DATA_CROSS_NODE m_dCrossNode; D3D12_FEATURE_DATA_D3D12_OPTIONS5 m_dOptions5; -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#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 m_dProtectedResourceSessionTypeCount; // Cat2 NodeIndex std::vector m_dProtectedResourceSessionTypes; // Cat3 -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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 }; // Implementations for CD3DX12FeatureSupport functions @@ -5169,28 +5731,41 @@ inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept , m_dOptions4{} , m_dCrossNode{} , m_dOptions5{} -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) , m_dDisplayable{} #endif , m_dOptions6{} , m_dOptions7{} -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3) , m_dOptions8{} , m_dOptions9{} #endif -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) , m_dOptions10{} , m_dOptions11{} #endif -#if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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 {} inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) @@ -5254,7 +5829,7 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) m_dOptions5 = {}; } -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_DISPLAYABLE, &m_dDisplayable, sizeof(m_dDisplayable)))) { m_dDisplayable = {}; @@ -5271,7 +5846,7 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) m_dOptions7 = {}; } -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#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 = {}; @@ -5283,7 +5858,7 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) } #endif -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#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 = {}; @@ -5295,20 +5870,22 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) } #endif -#if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#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(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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 = {}; @@ -5318,12 +5895,37 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) { 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 // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#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 // Initialize per-node feature support data structures const UINT uNodeCount = m_pDevice->GetNodeCount(); @@ -5585,7 +6187,7 @@ 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(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 4) // 28: Displayable FEATURE_SUPPORT_GET(BOOL, m_dDisplayable, DisplayableTexture); // SharedResourceCompatibilityTier handled in D3D12Options4 @@ -5615,7 +6217,7 @@ FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(UINT, m_dProtectedResourceSessionTypeCount // 34: Protected Resource Session Types FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(std::vector, m_dProtectedResourceSessionTypes, TypeVec, ProtectedResourceSessionTypes); -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3) // 36: Options8 FEATURE_SUPPORT_GET(BOOL, m_dOptions8, UnalignedBlockTexturesSupported); @@ -5628,7 +6230,7 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions9, DerivativesInMeshAndAmplificationShadersS FEATURE_SUPPORT_GET(D3D12_WAVE_MMA_TIER, m_dOptions9, WaveMMATier); #endif -#if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) +#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); @@ -5637,12 +6239,14 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions10, MeshShaderPerPrimitiveShadingRateSupport FEATURE_SUPPORT_GET(BOOL, m_dOptions11, AtomicInt64OnDescriptorHeapResourceSupported); #endif -#if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) +#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); @@ -5652,7 +6256,7 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions13, TextureCopyBetweenDimensionsSupported); FEATURE_SUPPORT_GET(BOOL, m_dOptions13, AlphaBlendFactorSupported); #endif -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#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); @@ -5661,10 +6265,34 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions14, IndependentFrontAndBackStencilRefMaskSup // 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 // NTDDI_WIN10_CU || USING_D3D12_AGILITY_SDK +#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 // Helper function to decide the highest shader model supported by the system // Stores the result in m_dShaderModel @@ -5676,10 +6304,10 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel() const D3D_SHADER_MODEL allModelVersions[] = { -#if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) D3D_SHADER_MODEL_6_8, #endif -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3) D3D_SHADER_MODEL_6_7, #endif D3D_SHADER_MODEL_6_6, @@ -5722,7 +6350,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion() const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] = { -#if defined(NTDDI_WIN10_CU) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) D3D_ROOT_SIGNATURE_VERSION_1_2, #endif D3D_ROOT_SIGNATURE_VERSION_1_1, @@ -5760,7 +6388,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel() // Needs to be updated for future feature levels const D3D_FEATURE_LEVEL allLevels[] = { -#if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 3) D3D_FEATURE_LEVEL_12_2, #endif D3D_FEATURE_LEVEL_12_1,