Update for latest fixes for D3DX12.h

This commit is contained in:
Chuck Walbourn 2021-10-22 16:43:43 -07:00
parent ac9f540897
commit 6c661ae6d8

View File

@ -76,7 +76,7 @@ struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT
FLOAT minDepth = D3D12_MIN_DEPTH,
FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept
{
auto Desc = pResource->GetDesc();
const auto Desc = pResource->GetDesc();
const UINT64 SubresourceWidth = Desc.Width >> mipSlice;
const UINT64 SubresourceHeight = Desc.Height >> mipSlice;
switch (Desc.Dimension)
@ -807,7 +807,7 @@ struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
Format = resDesc.Format;
Width = UINT( resDesc.Width );
Height = resDesc.Height;
Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1);
Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u);
RowPitch = rowPitch;
}
};
@ -1679,7 +1679,7 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
};
//------------------------------------------------------------------------------------------------
inline constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept
constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept
{
return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize;
}
@ -1795,13 +1795,13 @@ struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
mipLevels, format, 1, 0, layout, flags );
}
inline UINT16 Depth() const noexcept
{ return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
{ return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
inline UINT16 ArraySize() const noexcept
{ return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
{ 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 MipLevels * ArraySize() * PlaneCount(pDevice); }
{ 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()); }
};
@ -1920,13 +1920,13 @@ struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
mipLevels, format, 1, 0, layout, flags, 0, 0, 0 );
}
inline UINT16 Depth() const noexcept
{ return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
{ return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); }
inline UINT16 ArraySize() const noexcept
{ return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
{ 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 MipLevels * ArraySize() * PlaneCount(pDevice); }
{ 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()); }
};
@ -2026,7 +2026,7 @@ inline UINT64 GetRequiredIntermediateSize(
_In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
_In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources) noexcept
{
auto Desc = pDestinationResource->GetDesc();
const auto Desc = pDestinationResource->GetDesc();
UINT64 RequiredSize = 0;
ID3D12Device* pDevice = nullptr;
@ -2052,8 +2052,8 @@ inline UINT64 UpdateSubresources(
_In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
{
// Minor validation
auto IntermediateDesc = pIntermediate->GetDesc();
auto DestinationDesc = pDestinationResource->GetDesc();
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) ||
@ -2111,8 +2111,8 @@ inline UINT64 UpdateSubresources(
_In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
{
// Minor validation
auto IntermediateDesc = pIntermediate->GetDesc();
auto DestinationDesc = pDestinationResource->GetDesc();
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) ||
@ -2166,7 +2166,7 @@ inline UINT64 UpdateSubresources(
_In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept
{
UINT64 RequiredSize = 0;
auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
const auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
if (MemToAlloc > SIZE_MAX)
{
return 0;
@ -2180,13 +2180,13 @@ inline UINT64 UpdateSubresources(
auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
auto Desc = pDestinationResource->GetDesc();
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();
UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
HeapFree(GetProcessHeap(), 0, pMem);
return Result;
}
@ -2201,10 +2201,10 @@ inline UINT64 UpdateSubresources(
_In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
_In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
_In_ const void* pResourceData,
_In_reads_(NumSubresources) D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
_In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
{
UINT64 RequiredSize = 0;
auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
const auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
if (MemToAlloc > SIZE_MAX)
{
return 0;
@ -2214,17 +2214,17 @@ inline UINT64 UpdateSubresources(
{
return 0;
}
auto pLayouts = reinterpret_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
auto pLayouts = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
auto Desc = pDestinationResource->GetDesc();
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();
UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, pSrcData);
const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, pSrcData);
HeapFree(GetProcessHeap(), 0, pMem);
return Result;
}
@ -2246,7 +2246,7 @@ inline UINT64 UpdateSubresources(
UINT NumRows[MaxSubresources];
UINT64 RowSizesInBytes[MaxSubresources];
auto Desc = pDestinationResource->GetDesc();
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);
@ -2266,14 +2266,14 @@ inline UINT64 UpdateSubresources(
_In_range_(0,MaxSubresources) UINT FirstSubresource,
_In_range_(1,MaxSubresources-FirstSubresource) UINT NumSubresources,
_In_ const void* pResourceData,
_In_reads_(NumSubresources) D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
_In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept
{
UINT64 RequiredSize = 0;
D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
UINT NumRows[MaxSubresources];
UINT64 RowSizesInBytes[MaxSubresources];
auto Desc = pDestinationResource->GetDesc();
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);
@ -2283,7 +2283,7 @@ inline UINT64 UpdateSubresources(
}
//------------------------------------------------------------------------------------------------
inline constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept
constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept
{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; }
//------------------------------------------------------------------------------------------------
@ -3792,7 +3792,7 @@ private:
}
void* Data() noexcept override { return &m_Desc; }
D3D12_HIT_GROUP_DESC m_Desc;
static const UINT m_NumStrings = 4;
static constexpr UINT m_NumStrings = 4;
CD3DX12_STATE_OBJECT_DESC::StringContainer
m_Strings[m_NumStrings]; // one string for every entrypoint name
};
@ -4049,63 +4049,63 @@ class CD3DX12FeatureSupport
{
public: // Function declaration
// Default constructor that creates an empty object
CD3DX12FeatureSupport();
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 { return m_hStatus; }
HRESULT GetStatus() const noexcept { return m_hStatus; }
// Getter functions for each feature class
// D3D12_OPTIONS
BOOL DoublePrecisionFloatShaderOps() const;
BOOL OutputMergerLogicOp() const;
D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport() const;
D3D12_TILED_RESOURCES_TIER TiledResourcesTier() const;
D3D12_RESOURCE_BINDING_TIER ResourceBindingTier() const;
BOOL PSSpecifiedStencilRefSupported() const;
BOOL TypedUAVLoadAdditionalFormats() const;
BOOL ROVsSupported() const;
D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier() const;
BOOL StandardSwizzle64KBSupported() const;
BOOL CrossAdapterRowMajorTextureSupported() const;
BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation() const;
D3D12_RESOURCE_HEAP_TIER ResourceHeapTier() const;
D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier() const;
UINT MaxGPUVirtualAddressBitsPerResource() const;
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;
D3D_FEATURE_LEVEL MaxSupportedFeatureLevel() const noexcept;
// FORMAT_SUPPORT
HRESULT FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2);
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);
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);
HRESULT FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const;
// GPU_VIRTUAL_ADDRESS_SUPPORT
UINT MaxGPUVirtualAddressBitsPerProcess() const;
UINT MaxGPUVirtualAddressBitsPerProcess() const noexcept;
// SHADER_MODEL
D3D_SHADER_MODEL HighestShaderModel() const;
D3D_SHADER_MODEL HighestShaderModel() const noexcept;
// D3D12_OPTIONS1
BOOL WaveOps() const;
UINT WaveLaneCountMin() const;
UINT WaveLaneCountMax() const;
UINT TotalLaneCount() const;
BOOL ExpandedComputeResourceStates() const;
BOOL Int64ShaderOps() const;
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;
D3D_ROOT_SIGNATURE_VERSION HighestRootSignatureVersion() const noexcept;
// ARCHITECTURE1
BOOL TileBasedRenderer(UINT NodeIndex = 0) const;
@ -4114,59 +4114,59 @@ public: // Function declaration
BOOL IsolatedMMU(UINT NodeIndex = 0) const;
// D3D12_OPTIONS2
BOOL DepthBoundsTestSupported() const;
D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const;
BOOL DepthBoundsTestSupported() const noexcept;
D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const noexcept;
// SHADER_CACHE
D3D12_SHADER_CACHE_SUPPORT_FLAGS ShaderCacheSupportFlags() const;
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;
BOOL CastingFullyTypedFormatSupported() const;
D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags() const;
D3D12_VIEW_INSTANCING_TIER ViewInstancingTier() const;
BOOL BarycentricsSupported() const;
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;
BOOL ExistingHeapsSupported() const noexcept;
// D3D12_OPTIONS4
BOOL MSAA64KBAlignedTextureSupported() const;
D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier() const;
BOOL Native16BitShaderOpsSupported() const;
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;
BOOL CrossNodeAtomicShaderInstructions() const noexcept;
// D3D12_OPTIONS5
BOOL SRVOnlyTiledResourceTier3() const;
D3D12_RENDER_PASS_TIER RenderPassesTier() const;
D3D12_RAYTRACING_TIER RaytracingTier() const;
BOOL SRVOnlyTiledResourceTier3() const noexcept;
D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept;
D3D12_RAYTRACING_TIER RaytracingTier() const noexcept;
// DISPLAYABLE
BOOL DisplayableTexture() const;
BOOL DisplayableTexture() const noexcept;
// SharedResourceCompatibilityTier handled in D3D12Options4
// D3D12_OPTIONS6
BOOL AdditionalShadingRatesSupported() const;
BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing() const;
D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier() const;
UINT ShadingRateImageTileSize() const;
BOOL BackgroundProcessingSupported() const;
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);
HRESULT QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const;
// D3D12_OPTIONS7
D3D12_MESH_SHADER_TIER MeshShaderTier() const;
D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier() const;
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;
@ -4175,22 +4175,22 @@ public: // Function declaration
std::vector<GUID> ProtectedResourceSessionTypes(UINT NodeIndex = 0) const;
// D3D12_OPTIONS8
BOOL UnalignedBlockTexturesSupported() const;
BOOL UnalignedBlockTexturesSupported() const noexcept;
// D3D12_OPTIONS9
BOOL MeshShaderPipelineStatsSupported() const;
BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex() const;
BOOL AtomicInt64OnTypedResourceSupported() const;
BOOL AtomicInt64OnGroupSharedSupported() const;
BOOL DerivativesInMeshAndAmplificationShadersSupported() const;
D3D12_WAVE_MMA_TIER WaveMMATier() const;
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;
BOOL MeshShaderPerPrimitiveShadingRateSupported() const;
BOOL VariableRateShadingSumCombinerSupported() const noexcept;
BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept;
// D3D12_OPTIONS11
BOOL AtomicInt64OnDescriptorHeapResourceSupported() const;
BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept;
private: // Private structs and helpers declaration
struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES
@ -4254,7 +4254,7 @@ private: // Member data
// 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 \
inline RETTYPE CD3DX12FeatureSupport::OPTION() const noexcept \
{ \
return FEATURE.OPTION; \
}
@ -4262,7 +4262,7 @@ inline RETTYPE CD3DX12FeatureSupport::OPTION() const \
// 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 \
inline RETTYPE CD3DX12FeatureSupport::NAME() const noexcept \
{\
return FEATURE.OPTION; \
}
@ -4283,9 +4283,30 @@ inline RETTYPE CD3DX12FeatureSupport::NAME(UINT NodeIndex) const \
return FEATURE[NodeIndex].OPTION; \
}
inline CD3DX12FeatureSupport::CD3DX12FeatureSupport()
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{}
{}
inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice)
@ -4305,7 +4326,7 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice)
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 = (D3D12_RESOURCE_BINDING_TIER)0;
m_dOptions.ResourceBindingTier = static_cast<D3D12_RESOURCE_BINDING_TIER>(0);
m_dOptions.PSSpecifiedStencilRefSupported = false;
m_dOptions.TypedUAVLoadAdditionalFormats = false;
m_dOptions.ROVsSupported = false;
@ -4315,7 +4336,7 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice)
m_dOptions.CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED;
m_dOptions.CrossAdapterRowMajorTextureSupported = false;
m_dOptions.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = false;
m_dOptions.ResourceHeapTier = (D3D12_RESOURCE_HEAP_TIER)0;
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))))
@ -4512,7 +4533,7 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions, VPAndRTArrayIndexFromAnyShaderFeedingRaste
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
inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier() const noexcept
{
if (m_dCrossNode.SharingTier > D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED)
{
@ -4524,7 +4545,7 @@ inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier
}
}
inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const
inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const noexcept
{
if (m_dOptions.MaxGPUVirtualAddressBitsPerResource > 0)
{
@ -4541,13 +4562,13 @@ inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const
// 2: Feature Levels
// Simply returns the highest supported feature level
inline D3D_FEATURE_LEVEL CD3DX12FeatureSupport::MaxSupportedFeatureLevel() const
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)
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;
@ -4562,7 +4583,7 @@ inline HRESULT CD3DX12FeatureSupport::FormatSupport(DXGI_FORMAT Format, D3D12_FO
}
// 4: Multisample Quality Levels
inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels)
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;
@ -4584,7 +4605,7 @@ inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Forma
}
// 5: Format Info
inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount)
inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const
{
D3D12_FEATURE_DATA_FORMAT_INFO dFormatInfo;
dFormatInfo.Format = Format;
@ -4606,7 +4627,7 @@ inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& Plan
FEATURE_SUPPORT_GET(UINT, m_dGPUVASupport, MaxGPUVirtualAddressBitsPerProcess);
// 7: Shader Model
inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const
inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const noexcept
{
return m_dShaderModel.HighestShaderModel;
}
@ -4626,7 +4647,7 @@ inline D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS CD3DX12FeatureSupport::Pro
}
// 12: Root Signature
inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const
inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const noexcept
{
return m_dRootSignature.HighestVersion;
}
@ -4699,7 +4720,7 @@ 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)
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));
}
@ -4740,7 +4761,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel()
// Check support in descending order
HRESULT result;
D3D_SHADER_MODEL allModelVersions[] =
const D3D_SHADER_MODEL allModelVersions[] =
{
D3D_SHADER_MODEL_6_7,
D3D_SHADER_MODEL_6_6,
@ -4752,10 +4773,9 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel()
D3D_SHADER_MODEL_6_0,
D3D_SHADER_MODEL_5_1
};
constexpr size_t numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL);
UINT numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL);
for (UINT i = 0; i < numModelVersions; i++)
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));
@ -4765,14 +4785,14 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel()
// Also terminate on unexpected error code
if (FAILED(result))
{
m_dShaderModel.HighestShaderModel = (D3D_SHADER_MODEL)0;
m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
}
return result;
}
}
// Shader model may not be supported. Continue the rest initializations
m_dShaderModel.HighestShaderModel = (D3D_SHADER_MODEL)0;
m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0);
return S_OK;
}
@ -4782,15 +4802,15 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion()
{
HRESULT result;
D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] =
const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] =
{
D3D_ROOT_SIGNATURE_VERSION_1_1,
D3D_ROOT_SIGNATURE_VERSION_1_0,
D3D_ROOT_SIGNATURE_VERSION_1,
};
UINT numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION);
constexpr size_t numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION);
for (UINT i = 0; i < numRootSignatureVersions; i++)
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));
@ -4798,7 +4818,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion()
{
if (FAILED(result))
{
m_dRootSignature.HighestVersion = (D3D_ROOT_SIGNATURE_VERSION)0;
m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
}
// If succeeded, the highest version is already written into the member struct
return result;
@ -4806,7 +4826,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion()
}
// No version left. Set to invalid value and continue.
m_dRootSignature.HighestVersion = (D3D_ROOT_SIGNATURE_VERSION)0;
m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0);
return S_OK;
}
@ -4817,7 +4837,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel()
// Check against a list of all feature levels present in d3dcommon.h
// Needs to be updated for future feature levels
D3D_FEATURE_LEVEL allLevels[] =
const D3D_FEATURE_LEVEL allLevels[] =
{
D3D_FEATURE_LEVEL_12_2,
D3D_FEATURE_LEVEL_12_1,
@ -4833,7 +4853,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel()
};
D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel;
dFeatureLevel.NumFeatureLevels = sizeof(allLevels) / sizeof(D3D_FEATURE_LEVEL);
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));
@ -4843,7 +4863,7 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel()
}
else
{
m_eMaxFeatureLevel = (D3D_FEATURE_LEVEL)0;
m_eMaxFeatureLevel = static_cast<D3D_FEATURE_LEVEL>(0);
if (result == DXGI_ERROR_UNSUPPORTED)
{
@ -4889,5 +4909,3 @@ inline HRESULT CD3DX12FeatureSupport::QueryProtectedResourceSessionTypes(UINT No
#endif // defined( __cplusplus )
#endif //__D3DX12_H__