summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-10-07 01:17:49 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-10-07 01:17:49 +0000
commit0376baa7d9047a405a14e6d1ae7186a9cdedd725 (patch)
tree907f73d629768232fc41db0bd2e468a35eae7dff /Graphics/GraphicsEngineD3D12
parentFew minor cosmetic code changes in D3D12 backend (diff)
downloadDiligentCore-0376baa7d9047a405a14e6d1ae7186a9cdedd725.tar.gz
DiligentCore-0376baa7d9047a405a14e6d1ae7186a9cdedd725.zip
Fixed minor potential issue in ~CPUDescriptorHeap()
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp b/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp
index cd9ac42a..f03a12e0 100644
--- a/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/DescriptorHeap.cpp
@@ -180,11 +180,10 @@ CPUDescriptorHeap::~CPUDescriptorHeap()
DEV_CHECK_ERR(Heap.GetNumAvailableDescriptors() == Heap.GetMaxDescriptors(), "Not all descriptors in the descriptor pool are released");
TotalDescriptors += Heap.GetMaxDescriptors();
}
- TotalDescriptors = std::max(TotalDescriptors, 1u);
LOG_INFO_MESSAGE(std::setw(38), std::left, GetD3D12DescriptorHeapTypeLiteralName(m_HeapDesc.Type), " CPU heap allocated pool count: ", m_HeapPool.size(),
". Max descriptors: ", m_MaxSize, '/', TotalDescriptors,
- " (", std::fixed, std::setprecision(2), m_MaxSize*100.0 / TotalDescriptors, "%).");
+ " (", std::fixed, std::setprecision(2), m_MaxSize*100.0 / std::max(TotalDescriptors, 1u), "%).");
}
#ifdef DEVELOPMENT