RyuKen/Ryujinx.Graphics/Gal/GalImage.cs
Alex Barney 1f554c1093 Do naming refactoring on Ryujinx.Graphics (#611)
* Renaming part 1

* Renaming part 2

* Renaming part 3

* Renaming part 4

* Renaming part 5

* Renaming part 6

* Renaming part 7

* Renaming part 8

* Renaming part 9

* Renaming part 10

* General cleanup

* Thought I got all of these

* Apply #595

* Additional renaming

* Tweaks from feedback

* Rename files
2019-03-04 12:45:25 +11:00

87 lines
No EOL
2.7 KiB
C#

using Ryujinx.Graphics.Texture;
namespace Ryujinx.Graphics.Gal
{
public struct GalImage
{
public int Width;
public int Height;
// FIXME: separate layer and depth
public int Depth;
public int LayerCount;
public int TileWidth;
public int GobBlockHeight;
public int GobBlockDepth;
public int Pitch;
public int MaxMipmapLevel;
public GalImageFormat Format;
public GalMemoryLayout Layout;
public GalTextureSource XSource;
public GalTextureSource YSource;
public GalTextureSource ZSource;
public GalTextureSource WSource;
public GalTextureTarget TextureTarget;
public GalImage(
int width,
int height,
int depth,
int layerCount,
int tileWidth,
int gobBlockHeight,
int gobBlockDepth,
GalMemoryLayout layout,
GalImageFormat format,
GalTextureTarget textureTarget,
int maxMipmapLevel = 1,
GalTextureSource xSource = GalTextureSource.Red,
GalTextureSource ySource = GalTextureSource.Green,
GalTextureSource zSource = GalTextureSource.Blue,
GalTextureSource wSource = GalTextureSource.Alpha)
{
Width = width;
Height = height;
LayerCount = layerCount;
Depth = depth;
TileWidth = tileWidth;
GobBlockHeight = gobBlockHeight;
GobBlockDepth = gobBlockDepth;
Layout = layout;
Format = format;
MaxMipmapLevel = maxMipmapLevel;
XSource = xSource;
YSource = ySource;
ZSource = zSource;
WSource = wSource;
TextureTarget = textureTarget;
Pitch = ImageUtils.GetPitch(format, width);
}
public bool SizeMatches(GalImage image, bool ignoreLayer = false)
{
if (ImageUtils.GetBytesPerPixel(Format) !=
ImageUtils.GetBytesPerPixel(image.Format))
{
return false;
}
if (ImageUtils.GetAlignedWidth(this) !=
ImageUtils.GetAlignedWidth(image))
{
return false;
}
bool result = Height == image.Height && Depth == image.Depth;
if (!ignoreLayer)
{
result = result && LayerCount == image.LayerCount;
}
return result;
}
}
}