move buffer allocators to separate file & fix: high memory usage

This commit is contained in:
Samuliak 2024-08-18 11:32:24 +02:00
parent 265785772a
commit 269e072139
4 changed files with 215 additions and 213 deletions

View file

@ -1492,8 +1492,9 @@ void MetalRenderer::BindStageResources(MTL::RenderCommandEncoder* renderCommandE
*/
auto& bufferAllocator = m_memoryManager->GetTemporaryBufferAllocator();
auto supportBuffer = bufferAllocator.GetBufferAllocation(sizeof(supportBufferData));
memcpy(supportBuffer.data, supportBufferData, sizeof(supportBufferData));
size_t size = shader->uniform.uniformRangeSize;
auto supportBuffer = bufferAllocator.GetBufferAllocation(size);
memcpy(supportBuffer.data, supportBufferData, size);
switch (shader->shaderType)
{