aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs')
-rw-r--r--src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs79
1 files changed, 47 insertions, 32 deletions
diff --git a/src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs b/src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs
index 52b3b11f..44090291 100644
--- a/src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs
+++ b/src/Ryujinx.Graphics.GAL/TextureCreateInfo.cs
@@ -6,13 +6,13 @@ namespace Ryujinx.Graphics.GAL
{
public readonly struct TextureCreateInfo : IEquatable<TextureCreateInfo>
{
- public int Width { get; }
- public int Height { get; }
- public int Depth { get; }
- public int Levels { get; }
- public int Samples { get; }
- public int BlockWidth { get; }
- public int BlockHeight { get; }
+ public int Width { get; }
+ public int Height { get; }
+ public int Depth { get; }
+ public int Levels { get; }
+ public int Samples { get; }
+ public int BlockWidth { get; }
+ public int BlockHeight { get; }
public int BytesPerPixel { get; }
public bool IsCompressed => (BlockWidth | BlockHeight) != 1;
@@ -29,37 +29,37 @@ namespace Ryujinx.Graphics.GAL
public SwizzleComponent SwizzleA { get; }
public TextureCreateInfo(
- int width,
- int height,
- int depth,
- int levels,
- int samples,
- int blockWidth,
- int blockHeight,
- int bytesPerPixel,
- Format format,
+ int width,
+ int height,
+ int depth,
+ int levels,
+ int samples,
+ int blockWidth,
+ int blockHeight,
+ int bytesPerPixel,
+ Format format,
DepthStencilMode depthStencilMode,
- Target target,
+ Target target,
SwizzleComponent swizzleR,
SwizzleComponent swizzleG,
SwizzleComponent swizzleB,
SwizzleComponent swizzleA)
{
- Width = width;
- Height = height;
- Depth = depth;
- Levels = levels;
- Samples = samples;
- BlockWidth = blockWidth;
- BlockHeight = blockHeight;
- BytesPerPixel = bytesPerPixel;
- Format = format;
+ Width = width;
+ Height = height;
+ Depth = depth;
+ Levels = levels;
+ Samples = samples;
+ BlockWidth = blockWidth;
+ BlockHeight = blockHeight;
+ BytesPerPixel = bytesPerPixel;
+ Format = format;
DepthStencilMode = depthStencilMode;
- Target = target;
- SwizzleR = swizzleR;
- SwizzleG = swizzleG;
- SwizzleB = swizzleB;
- SwizzleA = swizzleA;
+ Target = target;
+ SwizzleR = swizzleR;
+ SwizzleG = swizzleG;
+ SwizzleB = swizzleB;
+ SwizzleA = swizzleA;
}
public int GetMipSize(int level)
@@ -142,7 +142,7 @@ namespace Ryujinx.Graphics.GAL
return HashCode.Combine(Width, Height);
}
- bool IEquatable<TextureCreateInfo>.Equals(TextureCreateInfo other)
+ public bool Equals(TextureCreateInfo other)
{
return Width == other.Width &&
Height == other.Height &&
@@ -160,5 +160,20 @@ namespace Ryujinx.Graphics.GAL
SwizzleB == other.SwizzleB &&
SwizzleA == other.SwizzleA;
}
+
+ public override bool Equals(object obj)
+ {
+ return obj is TextureCreateInfo info && this.Equals(info);
+ }
+
+ public static bool operator ==(TextureCreateInfo left, TextureCreateInfo right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(TextureCreateInfo left, TextureCreateInfo right)
+ {
+ return !(left == right);
+ }
}
}