metal: create buffer cache on startup

This commit is contained in:
Samuliak 2024-04-07 09:06:15 +02:00
parent d33d50780e
commit b3e8d8d11f
No known key found for this signature in database
2 changed files with 7 additions and 4 deletions

View file

@ -14,8 +14,6 @@
#include "video_core/renderer_metal/mtl_rasterizer.h" #include "video_core/renderer_metal/mtl_rasterizer.h"
#include "video_core/texture_cache/texture_cache_base.h" #include "video_core/texture_cache/texture_cache_base.h"
#include <iostream>
namespace Metal { namespace Metal {
AccelerateDMA::AccelerateDMA() = default; AccelerateDMA::AccelerateDMA() = default;
@ -34,6 +32,8 @@ RasterizerMetal::RasterizerMetal(Tegra::GPU& gpu_,
: gpu{gpu_}, device_memory{device_memory_}, device{device_}, : gpu{gpu_}, device_memory{device_memory_}, device{device_},
command_recorder{command_recorder_}, swap_chain{swap_chain_}, command_recorder{command_recorder_}, swap_chain{swap_chain_},
staging_buffer_pool(device, command_recorder), staging_buffer_pool(device, command_recorder),
buffer_cache_runtime(device, command_recorder, staging_buffer_pool),
buffer_cache(device_memory, buffer_cache_runtime),
texture_cache_runtime(device, command_recorder, staging_buffer_pool), texture_cache_runtime(device, command_recorder, staging_buffer_pool),
texture_cache(texture_cache_runtime, device_memory) {} texture_cache(texture_cache_runtime, device_memory) {}
RasterizerMetal::~RasterizerMetal() = default; RasterizerMetal::~RasterizerMetal() = default;
@ -255,4 +255,4 @@ void RasterizerMetal::ReleaseChannel(s32 channel_id) {
texture_cache.EraseChannel(channel_id); texture_cache.EraseChannel(channel_id);
} }
} // namespace Metal } // namespace Metal

View file

@ -4,10 +4,11 @@
#pragma once #pragma once
#include "common/common_types.h" #include "common/common_types.h"
#include "mtl_texture_cache.h" #include "mtl_buffer_cache.h"
#include "video_core/control/channel_state_cache.h" #include "video_core/control/channel_state_cache.h"
#include "video_core/engines/maxwell_dma.h" #include "video_core/engines/maxwell_dma.h"
#include "video_core/rasterizer_interface.h" #include "video_core/rasterizer_interface.h"
#include "video_core/renderer_metal/mtl_buffer_cache.h"
#include "video_core/renderer_metal/mtl_texture_cache.h" #include "video_core/renderer_metal/mtl_texture_cache.h"
namespace Core { namespace Core {
@ -102,6 +103,8 @@ private:
const SwapChain& swap_chain; const SwapChain& swap_chain;
StagingBufferPool staging_buffer_pool; StagingBufferPool staging_buffer_pool;
BufferCacheRuntime buffer_cache_runtime;
BufferCache buffer_cache;
TextureCacheRuntime texture_cache_runtime; TextureCacheRuntime texture_cache_runtime;
TextureCache texture_cache; TextureCache texture_cache;
}; };