From 383c0390370aa52243abfd1189d23b080cbfbb14 Mon Sep 17 00:00:00 2001 From: Mary Date: Tue, 17 Nov 2020 22:20:17 +0100 Subject: shader cache: Fix invalid virtual address clean up (#1717) * shader cache: Fix invalid virtual address clean up This fix an issue causing the virtual address of texture descriptors to not be cleaned up when caching and instead cleaning texture format and swizzle. This should fix duplicate high duplication in the cache for certain games and possible texture corruption issues. **THIS WILL INVALIDATE ALL SHADER CACHE LEVELS CONSIDERING THE NATURE OF THE ISSUE** * shader cache: Address gdk's comment --- Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs') diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs index ac5aedbe..b469aab5 100644 --- a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs +++ b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs @@ -35,9 +35,9 @@ namespace Ryujinx.Graphics.Gpu.Shader private Dictionary _cpProgramsDiskCache; /// - /// Version of the codegen (to be incremented when codegen changes). + /// Version of the codegen (to be changed when codegen or guest format change). /// - private const ulong ShaderCodeGenVersion = 1; + private const ulong ShaderCodeGenVersion = 1717; /// /// Creates a new instance of the shader cache. @@ -888,7 +888,7 @@ namespace Ryujinx.Graphics.Gpu.Shader foreach (int textureHandle in textureHandlesInUse) { - GuestTextureDescriptor textureDescriptor = gpuAccessor.GetTextureDescriptor(textureHandle).ToCache(); + GuestTextureDescriptor textureDescriptor = ((Image.TextureDescriptor)gpuAccessor.GetTextureDescriptor(textureHandle)).ToCache(); textureDescriptor.Handle = (uint)textureHandle; -- cgit v1.2.3