mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-28 03:32:02 +00:00
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.
This commit is contained in:
parent
6204f0e47a
commit
f35af5f703
1 changed files with 8 additions and 8 deletions
|
@ -14,19 +14,19 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
int srcDepth = src.DepthOrLayers;
|
int srcDepth = src.DepthOrLayers;
|
||||||
int srcLevels = src.Levels;
|
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 dstWidth = dst.Width;
|
||||||
int dstHeight = dst.Height;
|
int dstHeight = dst.Height;
|
||||||
int dstDepth = dst.DepthOrLayers;
|
int dstDepth = dst.DepthOrLayers;
|
||||||
int dstLevels = dst.Levels;
|
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,
|
// When copying from a compressed to a non-compressed format,
|
||||||
// the non-compressed texture will have the size of the texture
|
// the non-compressed texture will have the size of the texture
|
||||||
// in blocks (not in texels), so we must adjust that size to
|
// in blocks (not in texels), so we must adjust that size to
|
||||||
|
|
Loading…
Reference in a new issue