mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-22 13:37:06 +00:00
GL: use unique_ptr for prgramBinaryCache
This commit is contained in:
parent
08609591ae
commit
f6610b5b0c
2 changed files with 6 additions and 9 deletions
|
|
@ -266,8 +266,8 @@ void RendererShaderGL::ShaderCacheLoading_begin(uint64 cacheTitleId)
|
|||
{
|
||||
const uint32 cacheMagic = GeneratePrecompiledCacheId();
|
||||
const std::string cacheFilename = fmt::format("{:016x}_gl.bin", cacheTitleId);
|
||||
s_programBinaryCache = FileCache::Open(ActiveSettings::GetCachePath("shaderCache/precompiled/{}", cacheFilename), true, cacheMagic);
|
||||
if (s_programBinaryCache == nullptr)
|
||||
s_programBinaryCache.reset(FileCache::Open(ActiveSettings::GetCachePath("shaderCache/precompiled/{}", cacheFilename), true, cacheMagic));
|
||||
if (!s_programBinaryCache)
|
||||
cemuLog_log(LogType::Force, "Unable to open OpenGL precompiled cache {}", cacheFilename);
|
||||
}
|
||||
s_isLoadingShaders = true;
|
||||
|
|
@ -280,13 +280,10 @@ void RendererShaderGL::ShaderCacheLoading_end()
|
|||
|
||||
void RendererShaderGL::ShaderCacheLoading_Close()
|
||||
{
|
||||
if(s_programBinaryCache)
|
||||
{
|
||||
delete s_programBinaryCache;
|
||||
s_programBinaryCache = nullptr;
|
||||
}
|
||||
s_programBinaryCache.reset();
|
||||
g_compiled_shaders_total = 0;
|
||||
g_compiled_shaders_async = 0;
|
||||
}
|
||||
|
||||
FileCache* RendererShaderGL::s_programBinaryCache{};
|
||||
|
||||
std::unique_ptr<class FileCache> RendererShaderGL::s_programBinaryCache{};
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ private:
|
|||
bool m_shader_attached{ false };
|
||||
bool m_isCompiled{ false };
|
||||
|
||||
static class FileCache* s_programBinaryCache;
|
||||
static std::unique_ptr<class FileCache> s_programBinaryCache;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue