VideoBackends:Metal: Cache pipelines

Metal pipelines hold less stuff than Dolphin pipelines, so duplicates will appear
This commit is contained in:
TellowKrinkle
2022-06-13 02:24:33 -05:00
parent e32213d031
commit 5742ccf8de
11 changed files with 555 additions and 231 deletions

View File

@ -10,8 +10,12 @@
#include "VideoCommon/RenderState.h"
struct AbstractPipelineConfig;
class AbstractPipeline;
namespace Metal
{
class Shader;
extern MRCOwned<id<MTLDevice>> g_device;
extern MRCOwned<id<MTLCommandQueue>> g_queue;
@ -87,7 +91,12 @@ public:
void ReloadSamplers();
std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config);
void ShaderDestroyed(const Shader* shader);
private:
class Internal;
std::unique_ptr<Internal> m_internal;
MRCOwned<id<MTLSamplerState>> CreateSampler(SamplerSelector sel);
MRCOwned<id<MTLDepthStencilState>> m_dss[DepthStencilSelector::N_VALUES];
MRCOwned<id<MTLSamplerState>> m_samplers[SamplerSelector::N_VALUES];