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