mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
1f554c1093
* 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
87 lines
2.7 KiB
C#
87 lines
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;
|
|
}
|
|
}
|
|
} |