2018-09-18 05:30:35 +01:00
|
|
|
using Ryujinx.Graphics.Texture;
|
|
|
|
|
2018-04-08 20:17:35 +01:00
|
|
|
namespace Ryujinx.Graphics.Gal
|
|
|
|
{
|
2018-08-20 02:25:26 +01:00
|
|
|
public struct GalImage
|
2018-04-08 20:17:35 +01:00
|
|
|
{
|
|
|
|
public int Width;
|
|
|
|
public int Height;
|
2018-09-18 05:30:35 +01:00
|
|
|
public int TileWidth;
|
|
|
|
public int GobBlockHeight;
|
|
|
|
public int Pitch;
|
2018-04-08 20:17:35 +01:00
|
|
|
|
2018-09-18 05:30:35 +01:00
|
|
|
public GalImageFormat Format;
|
|
|
|
public GalMemoryLayout Layout;
|
2018-05-17 19:25:42 +01:00
|
|
|
public GalTextureSource XSource;
|
|
|
|
public GalTextureSource YSource;
|
|
|
|
public GalTextureSource ZSource;
|
|
|
|
public GalTextureSource WSource;
|
|
|
|
|
2018-08-20 02:25:26 +01:00
|
|
|
public GalImage(
|
2018-05-17 19:25:42 +01:00
|
|
|
int Width,
|
|
|
|
int Height,
|
2018-09-18 05:30:35 +01:00
|
|
|
int TileWidth,
|
|
|
|
int GobBlockHeight,
|
|
|
|
GalMemoryLayout Layout,
|
2018-08-20 02:25:26 +01:00
|
|
|
GalImageFormat Format,
|
|
|
|
GalTextureSource XSource = GalTextureSource.Red,
|
|
|
|
GalTextureSource YSource = GalTextureSource.Green,
|
|
|
|
GalTextureSource ZSource = GalTextureSource.Blue,
|
|
|
|
GalTextureSource WSource = GalTextureSource.Alpha)
|
2018-04-08 20:17:35 +01:00
|
|
|
{
|
2018-09-18 05:30:35 +01:00
|
|
|
this.Width = Width;
|
|
|
|
this.Height = Height;
|
|
|
|
this.TileWidth = TileWidth;
|
|
|
|
this.GobBlockHeight = GobBlockHeight;
|
|
|
|
this.Layout = Layout;
|
|
|
|
this.Format = Format;
|
|
|
|
this.XSource = XSource;
|
|
|
|
this.YSource = YSource;
|
|
|
|
this.ZSource = ZSource;
|
|
|
|
this.WSource = WSource;
|
|
|
|
|
|
|
|
Pitch = ImageUtils.GetPitch(Format, Width);
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool SizeMatches(GalImage Image)
|
|
|
|
{
|
|
|
|
if (ImageUtils.GetBytesPerPixel(Format) !=
|
|
|
|
ImageUtils.GetBytesPerPixel(Image.Format))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImageUtils.GetAlignedWidth(this) !=
|
|
|
|
ImageUtils.GetAlignedWidth(Image))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Height == Image.Height;
|
2018-04-08 20:17:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|