aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2020-12-01 22:48:31 +0100
committerGitHub <noreply@github.com>2020-12-01 22:48:31 +0100
commitf6d88558b1780df25088042771a75ab174f0a06c (patch)
treee3e1d1ece3b20be6a7b460226eb1e920f78e2087 /Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
parent5e6dc37aed22bd596db6a0e9c9a0527fc2a8e5b5 (diff)
salieri: Fix missing guest GPU accessor missing on hashes (#1759)
This adds the guest GPU accessor to hashes computation. As this change all the hashes from the cache, I added some migration logic. This is required for #1755.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
index f977e96b..ca0070fd 100644
--- a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
@@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
/// <summary>
/// Version of the guest cache shader (to increment when guest cache structure change).
/// </summary>
- private const ulong GuestCacheVersion = 1717;
+ private const ulong GuestCacheVersion = 1759;
/// <summary>
/// Create a new cache manager instance
@@ -45,7 +45,9 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
_hashType = hashType;
_shaderProvider = shaderProvider;
- string baseCacheDirectory = Path.Combine(AppDataManager.GamesDirPath, titleId, "cache", "shader");
+ string baseCacheDirectory = CacheHelper.GetBaseCacheDirectory(titleId);
+
+ CacheMigration.Run(baseCacheDirectory, graphicsApi, hashType, shaderProvider);
_guestProgramCache = new CacheCollection(baseCacheDirectory, _hashType, CacheGraphicsApi.Guest, "", "program", GuestCacheVersion);
_hostProgramCache = new CacheCollection(baseCacheDirectory, _hashType, _graphicsApi, _shaderProvider, "host", shaderCodeGenVersion);
@@ -81,16 +83,6 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
}
/// <summary>
- /// Computes the hash of some data using the current cache hashing algorithm.
- /// </summary>
- /// <param name="data">Some data to generate a hash for.</param>
- /// <returns>The hash of some data using the current hashing algorithm of the cache</returns>
- public Hash128 ComputeHash(ReadOnlySpan<byte> data)
- {
- return XXHash128.ComputeHash(data);
- }
-
- /// <summary>
/// Save a shader program not present in the program cache.
/// </summary>
/// <param name="programCodeHash">Target program code hash</param>