diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheCollection.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheCollection.cs
index effd893a..924d720b 100644
--- a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheCollection.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheCollection.cs
@@ -33,6 +33,11 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
///
SaveManifest,
+ ///
+ /// Remove entries from the hash manifest and save it.
+ ///
+ RemoveManifestEntries,
+
///
/// Flush temporary cache to archive.
///
@@ -227,11 +232,24 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
FlushToArchive();
}
+ ///
+ /// Queue a task to remove entries from the hash manifest.
+ ///
+ /// Entries to remove from the manifest
+ public void RemoveManifestEntriesAsync(HashSet entries)
+ {
+ _fileWriterWorkerQueue.Add(new CacheFileOperationTask
+ {
+ Type = CacheFileOperation.RemoveManifestEntries,
+ Data = entries
+ });
+ }
+
///
/// Remove given entries from the manifest.
///
/// Entries to remove from the manifest
- public void RemoveManifestEntries(HashSet entries)
+ private void RemoveManifestEntries(HashSet entries)
{
lock (_hashTable)
{
@@ -488,6 +506,9 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
case CacheFileOperation.SaveManifest:
SaveManifest();
break;
+ case CacheFileOperation.RemoveManifestEntries:
+ RemoveManifestEntries((HashSet)task.Data);
+ break;
case CacheFileOperation.FlushToArchive:
FlushToArchive();
break;
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
index 0c4eba2a..f977e96b 100644
--- a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
@@ -58,8 +58,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
/// Entries to remove from the manifest of all caches
public void RemoveManifestEntries(HashSet entries)
{
- _guestProgramCache.RemoveManifestEntries(entries);
- _hostProgramCache.RemoveManifestEntries(entries);
+ _guestProgramCache.RemoveManifestEntriesAsync(entries);
+ _hostProgramCache.RemoveManifestEntriesAsync(entries);
}
///