1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

RSX Cache: Prevent crash on failure to obtain cache directory (#10474)

This commit is contained in:
Eladash 2021-06-19 16:57:07 +03:00 committed by GitHub
parent 72680c7707
commit bbaa93c846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -199,14 +199,17 @@ namespace rsx
{
if (!g_cfg.video.disable_on_disk_shader_cache)
{
root_path = rpcs3::cache::get_ppu_cache() + "shaders_cache";
if (std::string cache_path = rpcs3::cache::get_ppu_cache(); !cache_path.empty())
{
root_path = std::move(cache_path) + "shaders_cache/";
}
}
}
template <typename... Args>
void load(shader_loading_dialog* dlg, Args&& ...args)
{
if (g_cfg.video.disable_on_disk_shader_cache)
if (root_path.empty())
{
return;
}
@ -270,7 +273,7 @@ namespace rsx
void store(const pipeline_storage_type &pipeline, const RSXVertexProgram &vp, const RSXFragmentProgram &fp)
{
if (g_cfg.video.disable_on_disk_shader_cache)
if (root_path.empty())
{
return;
}

View File

@ -16,7 +16,7 @@ namespace rpcs3::cache
if (!g_fxo->is_init<ppu_module>() || _main.cache.empty())
{
ppu_log.warning("PPU Cache location not initialized.");
ppu_log.error("PPU Cache location not initialized.");
return {};
}