diff options
Diffstat (limited to 'Ryujinx.Graphics/Texture')
| -rw-r--r-- | Ryujinx.Graphics/Texture/ImageUtils.cs | 6 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Texture/TextureFactory.cs | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Ryujinx.Graphics/Texture/ImageUtils.cs b/Ryujinx.Graphics/Texture/ImageUtils.cs index 18a179fb..1b043245 100644 --- a/Ryujinx.Graphics/Texture/ImageUtils.cs +++ b/Ryujinx.Graphics/Texture/ImageUtils.cs @@ -289,7 +289,11 @@ namespace Ryujinx.Graphics.Texture { ImageDescriptor Desc = GetImageDescriptor(Format); - return Desc.BytesPerPixel * DivRoundUp(Width, Desc.BlockWidth); + int Pitch = Desc.BytesPerPixel * DivRoundUp(Width, Desc.BlockWidth); + + Pitch = (Pitch + 0x1f) & ~0x1f; + + return Pitch; } public static int GetBlockWidth(GalImageFormat Format) diff --git a/Ryujinx.Graphics/Texture/TextureFactory.cs b/Ryujinx.Graphics/Texture/TextureFactory.cs index 766c53da..c0c53b06 100644 --- a/Ryujinx.Graphics/Texture/TextureFactory.cs +++ b/Ryujinx.Graphics/Texture/TextureFactory.cs @@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Texture int Width = (Tic[4] & 0xffff) + 1; int Height = (Tic[5] & 0xffff) + 1; - return new GalImage( + GalImage Image = new GalImage( Width, Height, TileWidth, @@ -51,6 +51,13 @@ namespace Ryujinx.Graphics.Texture YSource, ZSource, WSource); + + if (Layout == GalMemoryLayout.Pitch) + { + Image.Pitch = (Tic[3] & 0xffff) << 5; + } + + return Image; } public static GalTextureSampler MakeSampler(NvGpu Gpu, NvGpuVmm Vmm, long TscPosition) |
