2020-11-13 00:15:34 +01:00
|
|
|
|
using Ryujinx.Graphics.Gpu.Image;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2020-11-17 22:20:17 +01:00
|
|
|
|
/// Contains part of TextureDescriptor from <see cref="Image"/> used for shader codegen.
|
2020-11-13 00:15:34 +01:00
|
|
|
|
/// </summary>
|
2020-11-17 22:20:17 +01:00
|
|
|
|
[StructLayout(LayoutKind.Sequential, Size = 0xC, Pack = 1)]
|
|
|
|
|
struct GuestTextureDescriptor : ITextureDescriptor
|
2020-11-13 00:15:34 +01:00
|
|
|
|
{
|
|
|
|
|
public uint Handle;
|
2020-11-17 22:20:17 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
2020-11-13 00:15:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|