Allocate command buffers from pools
This commit is contained in:
@@ -8,6 +8,22 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline void OpenGLCommandPool::TryToShrink()
|
||||
{
|
||||
std::size_t poolCount = m_commandPools.size();
|
||||
if (poolCount >= 2 && m_commandPools.back().freeCommands.TestAll())
|
||||
{
|
||||
for (std::size_t i = poolCount - 1; i > 0; --i)
|
||||
{
|
||||
if (!m_commandPools[i].freeCommands.TestAll())
|
||||
break;
|
||||
|
||||
poolCount--;
|
||||
}
|
||||
|
||||
m_commandPools.resize(poolCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/OpenGLRenderer/DebugOff.hpp>
|
||||
|
||||
Reference in New Issue
Block a user