mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-22 22:37:04 +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 uint32 cacheMagic = GeneratePrecompiledCacheId();
|
||||||
const std::string cacheFilename = fmt::format("{:016x}_gl.bin", cacheTitleId);
|
const std::string cacheFilename = fmt::format("{:016x}_gl.bin", cacheTitleId);
|
||||||
s_programBinaryCache = FileCache::Open(ActiveSettings::GetCachePath("shaderCache/precompiled/{}", cacheFilename), true, cacheMagic);
|
s_programBinaryCache.reset(FileCache::Open(ActiveSettings::GetCachePath("shaderCache/precompiled/{}", cacheFilename), true, cacheMagic));
|
||||||
if (s_programBinaryCache == nullptr)
|
if (!s_programBinaryCache)
|
||||||
cemuLog_log(LogType::Force, "Unable to open OpenGL precompiled cache {}", cacheFilename);
|
cemuLog_log(LogType::Force, "Unable to open OpenGL precompiled cache {}", cacheFilename);
|
||||||
}
|
}
|
||||||
s_isLoadingShaders = true;
|
s_isLoadingShaders = true;
|
||||||
|
|
@ -280,13 +280,10 @@ void RendererShaderGL::ShaderCacheLoading_end()
|
||||||
|
|
||||||
void RendererShaderGL::ShaderCacheLoading_Close()
|
void RendererShaderGL::ShaderCacheLoading_Close()
|
||||||
{
|
{
|
||||||
if(s_programBinaryCache)
|
s_programBinaryCache.reset();
|
||||||
{
|
|
||||||
delete s_programBinaryCache;
|
|
||||||
s_programBinaryCache = nullptr;
|
|
||||||
}
|
|
||||||
g_compiled_shaders_total = 0;
|
g_compiled_shaders_total = 0;
|
||||||
g_compiled_shaders_async = 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_shader_attached{ false };
|
||||||
bool m_isCompiled{ 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