Correct texture width alignment
This commit is contained in:
parent
035f39038e
commit
b56620f1b3
2 changed files with 4 additions and 9 deletions
|
@ -93,11 +93,6 @@ namespace Ryujinx.HLE.Gpu.Engines
|
|||
bool IsSrcFb = Gpu.Engine3d.IsFrameBufferPosition(SrcKey);
|
||||
bool IsDstFb = Gpu.Engine3d.IsFrameBufferPosition(DstKey);
|
||||
|
||||
if (IsSrcFb && DstLinear)
|
||||
{
|
||||
DstSwizzle = TextureSwizzle.BlockLinear;
|
||||
}
|
||||
|
||||
TextureInfo SrcTexture = new TextureInfo(
|
||||
SrcAddress,
|
||||
SrcWidth,
|
||||
|
|
|
@ -9,11 +9,11 @@ namespace Ryujinx.HLE.Gpu.Texture
|
|||
{
|
||||
public static ISwizzle GetSwizzle(TextureInfo Texture, int BlockWidth, int Bpp)
|
||||
{
|
||||
int AlignMask = Texture.TileWidth * 64 - 1;
|
||||
int Width = (Texture.Width + (BlockWidth - 1)) / BlockWidth;
|
||||
|
||||
int WidthAligned = (Texture.Width + AlignMask) & ~AlignMask;
|
||||
int AlignMask = Texture.TileWidth * (64 / Bpp) - 1;
|
||||
|
||||
WidthAligned = (WidthAligned + (BlockWidth - 1)) / BlockWidth;
|
||||
Width = (Width + AlignMask) & ~AlignMask;
|
||||
|
||||
switch (Texture.Swizzle)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ namespace Ryujinx.HLE.Gpu.Texture
|
|||
|
||||
case TextureSwizzle.BlockLinear:
|
||||
case TextureSwizzle.BlockLinearColorKey:
|
||||
return new BlockLinearSwizzle(WidthAligned, Bpp, Texture.BlockHeight);
|
||||
return new BlockLinearSwizzle(Width, Bpp, Texture.BlockHeight);
|
||||
}
|
||||
|
||||
throw new NotImplementedException(Texture.Swizzle.ToString());
|
||||
|
|
Loading…
Add table
Reference in a new issue