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:
parent
72680c7707
commit
bbaa93c846
@ -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;
|
||||
}
|
||||
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user