aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestTextureDescriptor.cs34
1 files changed, 30 insertions, 4 deletions
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;
+ }
}
}