diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-07-19 02:30:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-19 02:30:21 -0300 |
| commit | 60f2198a1e8e61fe1cfb8da30a6afcd86a672a85 (patch) | |
| tree | be608a9f483e751d6d4bf4d9037048c94d495b0d /Ryujinx.HLE/Gpu/Texture/TextureHelper.cs | |
| parent | 8b685b12f0b7a901139999dff17b24b049b9084b (diff) | |
Support deswizzle of sparse tiled textures and some frame buffer fixes (#275)
* Attempt to support deswizzle of sparse tiled textures
* Use correct frame buffer and viewport sizes, started to clean up the copy engine
* Correct texture width alignment
* Use Scale/Translate registers to calculate viewport rect
* Allow texture copy between frame buffers
Diffstat (limited to 'Ryujinx.HLE/Gpu/Texture/TextureHelper.cs')
| -rw-r--r-- | Ryujinx.HLE/Gpu/Texture/TextureHelper.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs index de26c397..ecf2b6bf 100644 --- a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs +++ b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs @@ -7,8 +7,14 @@ namespace Ryujinx.HLE.Gpu.Texture { static class TextureHelper { - public static ISwizzle GetSwizzle(TextureInfo Texture, int Width, int Bpp) + public static ISwizzle GetSwizzle(TextureInfo Texture, int BlockWidth, int Bpp) { + int Width = (Texture.Width + (BlockWidth - 1)) / BlockWidth; + + int AlignMask = Texture.TileWidth * (64 / Bpp) - 1; + + Width = (Width + AlignMask) & ~AlignMask; + switch (Texture.Swizzle) { case TextureSwizzle._1dBuffer: |
