Skip to content

Commit

Permalink
Vertex pool: added UpdateAll method
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 17, 2023
1 parent 3b5b067 commit 6e6a3a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Graphics/GraphicsTools/interface/VertexPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ struct IVertexPool : public IObject
/// access.
virtual IBuffer* Update(Uint32 Index, IRenderDevice* pDevice, IDeviceContext* pContext) = 0;

/// Updates all internal buffers.
///
/// \remarks This method is equivalent to calling Update() for each internal buffer.
virtual void UpdateAll(IRenderDevice* pDevice, IDeviceContext* pContext) = 0;

/// Returns a pointer to the internal buffer at the given index.
///
Expand Down
6 changes: 6 additions & 0 deletions Graphics/GraphicsTools/src/VertexPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ class VertexPoolImpl final : public ObjectBase<IVertexPool>
return Buffer.Update(pDevice, pContext);
}

virtual void UpdateAll(IRenderDevice* pDevice, IDeviceContext* pContext) override final
{
for (Uint32 i = 0; i < m_Buffers.size(); ++i)
Update(i, pDevice, pContext);
}

virtual IBuffer* GetBuffer(Uint32 Index) const override final
{
if (Index >= m_Buffers.size())
Expand Down

0 comments on commit 6e6a3a0

Please sign in to comment.