mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 08:45:46 +00:00
d4187aaa9d
* (Re)Implement format reinterpretation, other changes * Implement writeback to guest memory, some refactoring * More refactoring, implement reinterpretation the old way again * Clean up * Some fixes on M2MF (old Dma engine), added partial support for P2MF, fix conditional ssy, add Z24S8 zeta format, other fixes * nit: Formatting * Address PR feedback
63 lines
No EOL
1.9 KiB
C#
63 lines
No EOL
1.9 KiB
C#
using Ryujinx.Graphics.Texture;
|
|
|
|
namespace Ryujinx.Graphics.Gal
|
|
{
|
|
public struct GalImage
|
|
{
|
|
public int Width;
|
|
public int Height;
|
|
public int TileWidth;
|
|
public int GobBlockHeight;
|
|
public int Pitch;
|
|
|
|
public GalImageFormat Format;
|
|
public GalMemoryLayout Layout;
|
|
public GalTextureSource XSource;
|
|
public GalTextureSource YSource;
|
|
public GalTextureSource ZSource;
|
|
public GalTextureSource WSource;
|
|
|
|
public GalImage(
|
|
int Width,
|
|
int Height,
|
|
int TileWidth,
|
|
int GobBlockHeight,
|
|
GalMemoryLayout Layout,
|
|
GalImageFormat Format,
|
|
GalTextureSource XSource = GalTextureSource.Red,
|
|
GalTextureSource YSource = GalTextureSource.Green,
|
|
GalTextureSource ZSource = GalTextureSource.Blue,
|
|
GalTextureSource WSource = GalTextureSource.Alpha)
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
} |