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
This commit is contained in:
Mary 2020-11-17 22:20:17 +01:00 committed by GitHub
parent 787e20937f
commit 383c039037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 58 additions and 22 deletions

View file

@ -35,9 +35,9 @@ namespace Ryujinx.Graphics.Gpu.Shader
private Dictionary<Hash128, ShaderBundle> _cpProgramsDiskCache;
/// <summary>
/// Version of the codegen (to be incremented when codegen changes).
/// Version of the codegen (to be changed when codegen or guest format change).
/// </summary>
private const ulong ShaderCodeGenVersion = 1;
private const ulong ShaderCodeGenVersion = 1717;
/// <summary>
/// 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;