Use correct pitch value when decoding linear swizzle textures

This commit is contained in:
gdkchan 2018-04-08 17:09:41 -03:00
parent b9aa3966c0
commit 36dfd20c87
4 changed files with 19 additions and 14 deletions

View file

@ -2,19 +2,18 @@ namespace Ryujinx.Graphics.Gpu
{
class LinearSwizzle : ISwizzle
{
private int Pitch;
private int Bpp;
private int Stride;
public LinearSwizzle(int Width, int Bpp)
public LinearSwizzle(int Pitch, int Bpp)
{
this.Bpp = Bpp;
Stride = Width * Bpp;
this.Pitch = Pitch;
this.Bpp = Bpp;
}
public int GetSwizzleOffset(int X, int Y)
{
return X * Bpp + Y * Stride;
return X * Bpp + Y * Pitch;
}
}
}