diff options
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoBackends/Metal/MTLObjectCache.mm | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm index c4ecfc0713..7dce7a0f34 100644 --- a/Source/Core/VideoBackends/Metal/MTLObjectCache.mm +++ b/Source/Core/VideoBackends/Metal/MTLObjectCache.mm @@ -27,16 +27,6 @@ std::unique_ptr<Metal::ObjectCache> Metal::g_object_cache; static void SetupDepthStencil( MRCOwned<id<MTLDepthStencilState>> (&dss)[Metal::DepthStencilSelector::N_VALUES]); -Metal::ObjectCache::ObjectCache() -{ - m_internal = std::make_unique<Internal>(); - SetupDepthStencil(m_dss); -} - -Metal::ObjectCache::~ObjectCache() -{ -} - void Metal::ObjectCache::Initialize(MRCOwned<id<MTLDevice>> device) { g_device = std::move(device); @@ -554,6 +544,17 @@ public: } }; +Metal::ObjectCache::ObjectCache() +{ + m_internal = std::make_unique<Internal>(); + SetupDepthStencil(m_dss); +} + +// This is defined here instead of the header so that the definition of Internal is visible when +// m_internal is destroyed, preventing a compile error caused by calling unique_ptr's destructor +// with an incomplete type. +Metal::ObjectCache::~ObjectCache() = default; + std::unique_ptr<AbstractPipeline> Metal::ObjectCache::CreatePipeline(const AbstractPipelineConfig& config) { |
