aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-08-11 15:59:42 -0300
committerGitHub <noreply@github.com>2021-08-11 20:59:42 +0200
commitd9d18439f6900fd9f05bde41998526281f7638c5 (patch)
tree14e8cd74e10ca9c92d1b85ccf17cecad00e3a8f7 /Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
parent70f79e689bc947313aab11c41e59928ce43be517 (diff)
Use a new approach for shader BRX targets (#2532)
* Use a new approach for shader BRX targets * Make shader cache actually work * Improve the shader pattern matching a bit * Extend LDC search to predecessor blocks, catches more cases * Nit * Only save the amount of constant buffer data actually used. Avoids crashes on partially mapped buffers * Ignore Rd on predicate instructions, as they do not have a Rd register (catches more cases)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
index 1ac37704..3fc11e82 100644
--- a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs
@@ -115,6 +115,16 @@ namespace Ryujinx.Graphics.Gpu.Shader.Cache
}
/// <summary>
+ /// Removes a shader program present in the program cache.
+ /// </summary>
+ /// <param name="programCodeHash">Target program code hash</param>
+ public void RemoveProgram(ref Hash128 programCodeHash)
+ {
+ _guestProgramCache.RemoveValue(ref programCodeHash);
+ _hostProgramCache.RemoveValue(ref programCodeHash);
+ }
+
+ /// <summary>
/// Get all guest program hashes.
/// </summary>
/// <returns>All guest program hashes</returns>