From 46f70e1e5dff07bb523e1b8c3e4b08694c80e84d Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Fri, 9 Sep 2022 13:27:37 -0700 Subject: [PATCH] Fix max resource heap tier from being incorrectly reported. --- src/gpgmm/d3d12/CapsD3D12.cpp | 5 +++-- src/gpgmm/d3d12/CapsD3D12.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gpgmm/d3d12/CapsD3D12.cpp b/src/gpgmm/d3d12/CapsD3D12.cpp index a8fd2ddd3..28da2efec 100644 --- a/src/gpgmm/d3d12/CapsD3D12.cpp +++ b/src/gpgmm/d3d12/CapsD3D12.cpp @@ -70,7 +70,7 @@ namespace gpgmm::d3d12 { return S_OK; } - HRESULT GetMaxResourceHeapTierSupported(ID3D12Device* device, + HRESULT SetMaxResourceHeapTierSupported(ID3D12Device* device, D3D12_RESOURCE_HEAP_TIER* maxResourceHeapTierOut) { D3D12_FEATURE_DATA_D3D12_OPTIONS options = {}; ReturnIfFailed( @@ -87,6 +87,7 @@ namespace gpgmm::d3d12 { std::unique_ptr caps(new Caps()); ReturnIfFailed(SetMaxResourceSize(device, &caps->mMaxResourceSize)); ReturnIfFailed(SetMaxResourceHeapSize(device, &caps->mMaxResourceHeapSize)); + ReturnIfFailed(SetMaxResourceHeapTierSupported(device, &caps->mMaxResourceHeapTier)); ReturnIfFailed( SetCreateHeapNotResidentSupported(device, &caps->mIsCreateHeapNotResidentSupported)); @@ -150,7 +151,7 @@ namespace gpgmm::d3d12 { return mIsAdapterCacheCoherentUMA; } - bool Caps::GetMaxResourceHeapTierSupported() const { + D3D12_RESOURCE_HEAP_TIER Caps::GetMaxResourceHeapTierSupported() const { return mMaxResourceHeapTier; } diff --git a/src/gpgmm/d3d12/CapsD3D12.h b/src/gpgmm/d3d12/CapsD3D12.h index 269e3dc90..9d2d6f7b7 100644 --- a/src/gpgmm/d3d12/CapsD3D12.h +++ b/src/gpgmm/d3d12/CapsD3D12.h @@ -45,7 +45,7 @@ namespace gpgmm::d3d12 { bool IsAdapterCacheCoherentUMA() const; // Specifies if a texture and buffer can belong in the same heap. - bool GetMaxResourceHeapTierSupported() const; + D3D12_RESOURCE_HEAP_TIER GetMaxResourceHeapTierSupported() const; private: Caps() = default;