fix: some Metal validation errors

This commit is contained in:
Samuliak 2024-08-17 17:51:37 +02:00
parent 502d5b8b2f
commit 83a08b2247
9 changed files with 216 additions and 99 deletions

View file

@ -47,11 +47,13 @@ public:
return m_buffers[bufferIndex];
}
MetalBufferAllocation GetBufferAllocation(size_t size, size_t alignment);
MetalBufferAllocation GetBufferAllocation(size_t size);
private:
class MetalRenderer* m_mtlr;
size_t m_allocationSize = 8 * 1024 * 1024;
std::vector<MTL::Buffer*> m_buffers;
std::vector<MetalBufferRange> m_freeBufferRanges;
};
@ -139,9 +141,9 @@ public:
return m_bufferAllocator/*s[bufferAllocatorIndex]*/.GetBuffer(bufferIndex);
}
MetalBufferAllocation GetBufferAllocation(size_t size, size_t alignment)
MetalBufferAllocation GetBufferAllocation(size_t size)
{
auto allocation = m_bufferAllocator/*s[m_bufferAllocatorIndex]*/.GetBufferAllocation(size, alignment);
auto allocation = m_bufferAllocator/*s[m_bufferAllocatorIndex]*/.GetBufferAllocation(size);
//allocation.bufferIndex |= (m_bufferAllocatorIndex << bufferAllocatorIndexShift);
return allocation;