Skip to content

Commit

Permalink
Vertex pool: fixed issue with updating committed memory size
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 20, 2023
1 parent 0f9e47b commit 3b27cf6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Graphics/GraphicsTools/src/VertexPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ class VertexPoolImpl final : public ObjectBase<IVertexPool>
// We must use atomic because this value is read in another thread,
// while m_Buffer internally does not use mutex or other synchronization.
BufferSize.store(Buffer.GetDesc().Size);

UpdateCommittedMemorySize();
}
return Buffer.Update(pDevice, pContext);
}
Expand Down Expand Up @@ -353,6 +355,10 @@ class VertexPoolImpl final : public ObjectBase<IVertexPool>
{
m_AllocatedVertexCount.store(m_Mgr.GetUsedSize());
m_TotalVertexCount.store(m_Mgr.GetMaxSize());
UpdateCommittedMemorySize();
}
void UpdateCommittedMemorySize()
{
Uint64 CommittedMemorySize = 0;
for (const auto& BuffSize : m_BufferSizes)
CommittedMemorySize += BuffSize.load();
Expand Down

0 comments on commit 3b27cf6

Please sign in to comment.