mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 05:51:19 +12:00
implement vertex descriptors & draw
This commit is contained in:
parent
e5395277a7
commit
cb525b22ff
9 changed files with 247 additions and 30 deletions
|
@ -1,22 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <Metal/Metal.hpp>
|
||||
|
||||
#include "Cafe/HW/Latte/ISA/LatteReg.h"
|
||||
|
||||
struct MetalBufferAllocation
|
||||
{
|
||||
void* data;
|
||||
uint32 bufferIndex;
|
||||
size_t bufferOffset;
|
||||
};
|
||||
|
||||
class MetalMemoryManager
|
||||
{
|
||||
public:
|
||||
MetalMemoryManager() = default;
|
||||
MetalMemoryManager(class MetalRenderer* metalRenderer) : m_mtlr{metalRenderer} {}
|
||||
|
||||
void* GetTextureUploadBuffer(size_t size)
|
||||
MTL::Buffer* GetBuffer(uint32 bufferIndex)
|
||||
{
|
||||
if (m_textureUploadBuffer.size() < size)
|
||||
{
|
||||
m_textureUploadBuffer.resize(size);
|
||||
}
|
||||
|
||||
return m_textureUploadBuffer.data();
|
||||
return m_buffers[bufferIndex];
|
||||
}
|
||||
|
||||
void* GetTextureUploadBuffer(size_t size);
|
||||
|
||||
MetalBufferAllocation GetBufferAllocation(size_t size);
|
||||
|
||||
private:
|
||||
class MetalRenderer* m_mtlr;
|
||||
|
||||
std::vector<uint8> m_textureUploadBuffer;
|
||||
std::vector<MTL::Buffer*> m_buffers;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue