diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-02-29 20:50:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-01 07:50:44 +1100 |
| commit | f35af5f703d1011bfb401972813f3d12d9a4a385 (patch) | |
| tree | e6c87e9160111ff1b28b7ff8ec9b5e650cd2b932 | |
| parent | 6204f0e47af73b7e9257955bbd7171c6c881a269 (diff) | |
Reduce copy destination size by target mipmap level, rather than source size. (#959)
* Change destination size by target mipmap level, rather than source.
* Check dst for Texture3D rather than src.
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/TextureCopyUnscaled.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.OpenGL/TextureCopyUnscaled.cs b/Ryujinx.Graphics.OpenGL/TextureCopyUnscaled.cs index 2597214a..cf13db8a 100644 --- a/Ryujinx.Graphics.OpenGL/TextureCopyUnscaled.cs +++ b/Ryujinx.Graphics.OpenGL/TextureCopyUnscaled.cs @@ -14,19 +14,19 @@ namespace Ryujinx.Graphics.OpenGL int srcDepth = src.DepthOrLayers; int srcLevels = src.Levels; - srcWidth = Math.Max(1, srcWidth >> dstLevel); - srcHeight = Math.Max(1, srcHeight >> dstLevel); - - if (src.Target == Target.Texture3D) - { - srcDepth = Math.Max(1, srcDepth >> dstLevel); - } - int dstWidth = dst.Width; int dstHeight = dst.Height; int dstDepth = dst.DepthOrLayers; int dstLevels = dst.Levels; + dstWidth = Math.Max(1, dstWidth >> dstLevel); + dstHeight = Math.Max(1, dstHeight >> dstLevel); + + if (dst.Target == Target.Texture3D) + { + dstDepth = Math.Max(1, dstDepth >> dstLevel); + } + // When copying from a compressed to a non-compressed format, // the non-compressed texture will have the size of the texture // in blocks (not in texels), so we must adjust that size to |
