diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-10-13 22:48:09 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 1bb08742c1df4ac1a9d4a5240fdf186db77bfbcc (patch) | |
| tree | b3ab6033e2eff9db0e685b9d469ef332ae2d6c99 /Ryujinx.Graphics.Gpu/Image/TextureManager.cs | |
| parent | 1876b346fea647e8284a66bb6d62c38801035cff (diff) | |
Calculate width from stride on texture copies
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureManager.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureManager.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs index 56dff9ad..23416ddd 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureManager.cs @@ -245,9 +245,20 @@ namespace Ryujinx.Graphics.Gpu.Image FormatInfo formatInfo = copyTexture.Format.Convert(); + int width; + + if (copyTexture.LinearLayout) + { + width = copyTexture.Stride / formatInfo.BytesPerPixel; + } + else + { + width = copyTexture.Width; + } + TextureInfo info = new TextureInfo( address, - copyTexture.Width, + width, copyTexture.Height, copyTexture.Depth, 1, |
