OpenGLRenderer/UploadPool: Fix Allocate with size > maxBlockSize

This commit is contained in:
Jérôme Leclercq 2021-09-05 15:47:26 +02:00
parent 732bb89a86
commit d704743712
1 changed files with 1 additions and 3 deletions

View File

@ -16,8 +16,6 @@ namespace Nz
auto OpenGLUploadPool::Allocate(UInt64 size, UInt64 /*alignment*/) -> Allocation& auto OpenGLUploadPool::Allocate(UInt64 size, UInt64 /*alignment*/) -> Allocation&
{ {
assert(size <= m_blockSize);
// Try to minimize lost space // Try to minimize lost space
struct struct
{ {
@ -47,7 +45,7 @@ namespace Nz
Block newBlock; Block newBlock;
newBlock.size = blockSize; newBlock.size = blockSize;
newBlock.memory.resize(m_blockSize); newBlock.memory.resize(blockSize);
bestBlock.block = &m_blocks.emplace_back(std::move(newBlock)); bestBlock.block = &m_blocks.emplace_back(std::move(newBlock));
bestBlock.offset = 0; bestBlock.offset = 0;