aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs')
-rw-r--r--Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs36
1 files changed, 31 insertions, 5 deletions
diff --git a/Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs b/Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs
index ef468e27..e6509baa 100644
--- a/Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs
+++ b/Ryujinx.Graphics/Graphics3d/Texture/LinearSwizzle.cs
@@ -1,3 +1,5 @@
+using System;
+
namespace Ryujinx.Graphics.Texture
{
class LinearSwizzle : ISwizzle
@@ -5,15 +7,39 @@ namespace Ryujinx.Graphics.Texture
private int Pitch;
private int Bpp;
- public LinearSwizzle(int Pitch, int Bpp)
+ private int SliceSize;
+
+ public LinearSwizzle(int Pitch, int Bpp, int Width, int Height)
{
- this.Pitch = Pitch;
- this.Bpp = Bpp;
+ this.Pitch = Pitch;
+ this.Bpp = Bpp;
+ SliceSize = Width * Height * Bpp;
+ }
+
+ public void SetMipLevel(int Level)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int GetMipOffset(int Level)
+ {
+ if (Level == 1)
+ return SliceSize;
+ throw new NotImplementedException();
+ }
+
+ public int GetImageSize(int MipsCount)
+ {
+ int Size = GetMipOffset(MipsCount);
+
+ Size = (Size + 0x1fff) & ~0x1fff;
+
+ return Size;
}
- public int GetSwizzleOffset(int X, int Y)
+ public int GetSwizzleOffset(int X, int Y, int Z)
{
- return X * Bpp + Y * Pitch;
+ return Z * SliceSize + X * Bpp + Y * Pitch;
}
}
} \ No newline at end of file