mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 22:11:18 +12:00
implement vertex descriptors & draw
This commit is contained in:
parent
e5395277a7
commit
cb525b22ff
9 changed files with 247 additions and 30 deletions
26
src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp
Normal file
26
src/Cafe/HW/Latte/Renderer/Metal/MetalMemoryManager.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "Cafe/HW/Latte/Renderer/Metal/MetalRenderer.h"
|
||||
|
||||
void* MetalMemoryManager::GetTextureUploadBuffer(size_t size)
|
||||
{
|
||||
if (m_textureUploadBuffer.size() < size)
|
||||
{
|
||||
m_textureUploadBuffer.resize(size);
|
||||
}
|
||||
|
||||
return m_textureUploadBuffer.data();
|
||||
}
|
||||
|
||||
// TODO: optimize this
|
||||
MetalBufferAllocation MetalMemoryManager::GetBufferAllocation(size_t size)
|
||||
{
|
||||
MTL::Buffer* buffer = m_mtlr->GetDevice()->newBuffer(size, MTL::ResourceStorageModeShared);
|
||||
|
||||
MetalBufferAllocation allocation;
|
||||
allocation.bufferIndex = m_buffers.size();
|
||||
allocation.bufferOffset = 0;
|
||||
allocation.data = buffer->contents();
|
||||
|
||||
m_buffers.push_back(buffer);
|
||||
|
||||
return allocation;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue