[dxvk] Add method to retrieve per-heap memory stats

This commit is contained in:
Philip Rebohle 2019-12-13 11:15:52 +01:00
parent 4fcf28f4dc
commit 8e587af0da
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 25 additions and 0 deletions

View File

@ -175,6 +175,11 @@ namespace dxvk {
result.merge(m_statCounters);
return result;
}
DxvkMemoryStats DxvkDevice::getMemoryStats(uint32_t heap) {
return m_objects.memoryManager().getMemoryStats(heap);
}
uint32_t DxvkDevice::getCurrentFrameId() const {

View File

@ -350,6 +350,14 @@ namespace dxvk {
*/
DxvkStatCounters getStatCounters();
/**
* \brief Retrieves memors statistics
*
* \param [in] heap Memory heap index
* \returns Memory stats for this heap
*/
DxvkMemoryStats getMemoryStats(uint32_t heap);
/**
* \brief Retreves current frame ID
* \returns Current frame ID

View File

@ -271,6 +271,18 @@ namespace dxvk {
*/
DxvkMemoryStats getMemoryStats();
/**
* \brief Queries memory stats
*
* Returns the total amount of memory
* allocated and used for a given heap.
* \param [in] heap Heap index
* \returns Memory stats for this heap
*/
DxvkMemoryStats getMemoryStats(uint32_t heap) const {
return m_memHeaps[heap].stats;
}
private:
const Rc<vk::DeviceFn> m_vkd;