gl_shader_disk_cache.cpp: Flush transferable_file and precompiled_file more often (#6483)

This commit is contained in:
SachinVin 2023-05-07 05:04:40 +05:30 committed by GitHub
parent 2e655f73b8
commit b4db9aebf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -372,6 +372,7 @@ void ShaderDiskCache::SaveRaw(const ShaderDiskCacheRaw& entry) {
return; return;
} }
transferable.insert({id, entry}); transferable.insert({id, entry});
transferable_file.Flush();
} }
void ShaderDiskCache::SaveDecompiled(u64 unique_identifier, void ShaderDiskCache::SaveDecompiled(u64 unique_identifier,
@ -439,6 +440,8 @@ void ShaderDiskCache::SaveDumpToFile(u64 unique_identifier, GLuint program, bool
// SaveDecompiled is used only to store the accurate multiplication setting, a better way is to // SaveDecompiled is used only to store the accurate multiplication setting, a better way is to
// probably change the header in SaveDump // probably change the header in SaveDump
SaveDecompiledToFile(precompiled_file, unique_identifier, {}, sanitize_mul); SaveDecompiledToFile(precompiled_file, unique_identifier, {}, sanitize_mul);
precompiled_file.Flush();
} }
bool ShaderDiskCache::IsUsable() const { bool ShaderDiskCache::IsUsable() const {