diff --git a/Hydrogent/interface/HnRenderDelegate.hpp b/Hydrogent/interface/HnRenderDelegate.hpp index 716a22a3..e022170b 100644 --- a/Hydrogent/interface/HnRenderDelegate.hpp +++ b/Hydrogent/interface/HnRenderDelegate.hpp @@ -78,6 +78,9 @@ struct HnRenderDelegateMemoryStats /// The number of allcations. Uint32 AllocationCount = 0; + + /// The amount of index data pending upload, in bytes. + Uint64 PendingDataSize = 0; }; /// Index pool usage statistics. IndexPoolUsage IndexPool; @@ -96,6 +99,9 @@ struct HnRenderDelegateMemoryStats /// The number of vertices allocated from the pool. Uint64 AllocatedVertexCount = 0; + + /// The amount vertex data pending upload, in bytes. + Uint64 PendingDataSize = 0; }; /// Vertex pool usage statistics. VertexPoolUsage VertexPool; @@ -468,6 +474,11 @@ class HnRenderDelegate final : public pxr::HdRenderDelegate Uint32 m_MaterialResourcesVersion = ~0u; Uint32 m_ShadowAtlasVersion = ~0u; Uint32 m_LightResourcesVersion = ~0u; + + // Amount of index data pending upload before the last call to m_GeometryPool->Commit + Uint64 m_LastPendingIndexDataSize = 0; + // Amount of vertex data pending upload before the last call to m_GeometryPool->Commit + Uint64 m_LastPendingVertexDataSize = 0; }; } // namespace USD diff --git a/Hydrogent/src/HnRenderDelegate.cpp b/Hydrogent/src/HnRenderDelegate.cpp index 13529012..1efbf047 100644 --- a/Hydrogent/src/HnRenderDelegate.cpp +++ b/Hydrogent/src/HnRenderDelegate.cpp @@ -637,7 +637,11 @@ void HnRenderDelegate::CommitResources(pxr::HdChangeTracker* tracker) m_ResourceMgr->UpdateIndexBuffer(m_pDevice, m_pContext); m_TextureRegistry->Commit(m_pContext); + + m_LastPendingIndexDataSize = m_GeometryPool->GetPendingIndexDataSize(); + m_LastPendingVertexDataSize = m_GeometryPool->GetPendingVertexDataSize(); m_GeometryPool->Commit(m_pContext); + if (m_ShadowMapManager) { m_ShadowMapManager->Commit(m_pDevice, m_pContext); @@ -825,11 +829,13 @@ HnRenderDelegateMemoryStats HnRenderDelegate::GetMemoryStats() const MemoryStats.IndexPool.CommittedSize = IndexUsage.CommittedSize; MemoryStats.IndexPool.UsedSize = IndexUsage.UsedSize; MemoryStats.IndexPool.AllocationCount = IndexUsage.AllocationCount; + MemoryStats.IndexPool.PendingDataSize = m_LastPendingIndexDataSize; MemoryStats.VertexPool.CommittedSize = VertexUsage.CommittedMemorySize; MemoryStats.VertexPool.UsedSize = VertexUsage.UsedMemorySize; MemoryStats.VertexPool.AllocationCount = VertexUsage.AllocationCount; MemoryStats.VertexPool.AllocatedVertexCount = VertexUsage.AllocatedVertexCount; + MemoryStats.VertexPool.PendingDataSize = m_LastPendingVertexDataSize; MemoryStats.Atlas.CommittedSize = AtlasUsage.CommittedSize; MemoryStats.Atlas.AllocationCount = AtlasUsage.AllocationCount;