mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-06 15:01:18 +12:00
implement new index cache
This commit is contained in:
parent
800aae4fdb
commit
24ff85b11f
5 changed files with 88 additions and 65 deletions
|
@ -73,7 +73,7 @@ void MetalMemoryManager::UploadToBufferCache(const void* data, size_t offset, si
|
|||
|
||||
if (m_bufferCacheMode == BufferCacheMode::DevicePrivate)
|
||||
{
|
||||
auto allocation = m_tempBufferAllocator.GetBufferAllocation(size);
|
||||
auto allocation = m_tempBufferAllocator.GetAllocation(size);
|
||||
auto buffer = m_tempBufferAllocator.GetBufferOutsideOfCommandBuffer(allocation.bufferIndex);
|
||||
memcpy((uint8*)buffer->contents() + allocation.offset, data, size);
|
||||
|
||||
|
@ -82,8 +82,8 @@ void MetalMemoryManager::UploadToBufferCache(const void* data, size_t offset, si
|
|||
|
||||
m_mtlr->CopyBufferToBuffer(buffer, allocation.offset, m_bufferCache, offset, size, ALL_MTL_RENDER_STAGES, ALL_MTL_RENDER_STAGES);
|
||||
|
||||
// Make sure the buffer has the right command buffer
|
||||
m_tempBufferAllocator.GetBuffer(allocation.bufferIndex); // TODO: make a helper function for this
|
||||
// Mark buffer as used
|
||||
m_tempBufferAllocator.MarkBufferAsUsed(allocation.bufferIndex);
|
||||
|
||||
// We can now safely unlock the buffer
|
||||
m_tempBufferAllocator.UnlockBuffer(allocation.bufferIndex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue