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