mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 13:01:27 +12:00
rsx: Shaders cache loading and saving bugfixes
* Fixed crash whenever files are missing from the cache. * Fixed crash whenever files are empty. * Fixed crash whenever file creation/overwrite of cache files failed. (handled by fs::write_file) * Fixed crash whenever there are any subdirectories inside the pipelines cache directories. * Overwrite invalid shader cache files if encountered such. * Optimizations have been added.
This commit is contained in:
parent
2b8eb8deb6
commit
247e90b3d0
2 changed files with 59 additions and 35 deletions
|
@ -733,9 +733,18 @@ namespace fs
|
|||
// Always use write flag, remove read flag
|
||||
if (fs::file f{path, mode + fs::write - fs::read})
|
||||
{
|
||||
// Write args sequentially
|
||||
(f.write(args), ...);
|
||||
return true;
|
||||
if constexpr (sizeof...(args) == 2u && (std::is_pointer_v<Args> || ...))
|
||||
{
|
||||
// Specialization for [const void*, usz] args
|
||||
f.write(args...);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write args sequentially
|
||||
(f.write(args), ...);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue