diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs | 34 |
2 files changed, 31 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/CacheManager.cs index d241eb01..0c4eba2a 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 = 1; + private const ulong GuestCacheVersion = 1717; /// <summary> /// Create a new cache manager instance diff --git a/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs b/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs index 7c73ef7b..9491496d 100644 --- a/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs +++ b/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs @@ -4,12 +4,38 @@ using System.Runtime.InteropServices; namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition { /// <summary> - /// Mostly identical to TextureDescriptor from <see cref="Image"/> but we don't store the address of the texture and store its handle instead. + /// Contains part of TextureDescriptor from <see cref="Image"/> used for shader codegen. /// </summary> - [StructLayout(LayoutKind.Sequential, Size = 0x20, Pack = 1)] - struct GuestTextureDescriptor + [StructLayout(LayoutKind.Sequential, Size = 0xC, Pack = 1)] + struct GuestTextureDescriptor : ITextureDescriptor { public uint Handle; - internal TextureDescriptor Descriptor; + public uint Format; + public TextureTarget Target; + [MarshalAs(UnmanagedType.I1)] + public bool IsSrgb; + [MarshalAs(UnmanagedType.I1)] + public bool IsTextureCoordNormalized; + public byte Reserved; + + public uint UnpackFormat() + { + return Format; + } + + public bool UnpackSrgb() + { + return IsSrgb; + } + + public bool UnpackTextureCoordNormalized() + { + return IsTextureCoordNormalized; + } + + public TextureTarget UnpackTextureTarget() + { + return Target; + } } } |
