aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2020-11-20 20:14:45 +0000
committerGitHub <noreply@github.com>2020-11-20 17:14:45 -0300
commit9493cdfe553d77d8f37927ef2acf87cfbab1c467 (patch)
tree9c5e5b588c1fa9372274d3d780b4cbb041bf24c5 /Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
parentcf7044e37bc628f25525941d25b830594b833428 (diff)
Allow copy destination to have a different scale from source (#1711)
* Allow copy destination to have a different scale from source Will result in more scaled copy destinations, but allows scaling in some games that copy textures to the output framebuffer. * Support copying multiple levels/layers Uses glFramebufferTextureLayer to copy multiple layers, copies levels individually (and scales the regions). Remove CopyArrayScaled, since the backend copy handles it now.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs21
1 files changed, 7 insertions, 14 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
index 430b733e..173f5fe4 100644
--- a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
@@ -71,12 +71,8 @@ namespace Ryujinx.Graphics.Gpu.Engine
return;
}
- if (srcTexture.ScaleFactor != dstTexture.ScaleFactor)
- {
- srcTexture.PropagateScale(dstTexture);
- }
-
- float scale = srcTexture.ScaleFactor; // src and dest scales are identical now.
+ float scale = srcTexture.ScaleFactor;
+ float dstScale = dstTexture.ScaleFactor;
Extents2D srcRegion = new Extents2D(
(int)Math.Ceiling(scale * (srcX1 / srcTexture.Info.SamplesInX)),
@@ -85,10 +81,10 @@ namespace Ryujinx.Graphics.Gpu.Engine
(int)Math.Ceiling(scale * (srcY2 / srcTexture.Info.SamplesInY)));
Extents2D dstRegion = new Extents2D(
- (int)Math.Ceiling(scale * (dstX1 / dstTexture.Info.SamplesInX)),
- (int)Math.Ceiling(scale * (dstY1 / dstTexture.Info.SamplesInY)),
- (int)Math.Ceiling(scale * (dstX2 / dstTexture.Info.SamplesInX)),
- (int)Math.Ceiling(scale * (dstY2 / dstTexture.Info.SamplesInY)));
+ (int)Math.Ceiling(dstScale * (dstX1 / dstTexture.Info.SamplesInX)),
+ (int)Math.Ceiling(dstScale * (dstY1 / dstTexture.Info.SamplesInY)),
+ (int)Math.Ceiling(dstScale * (dstX2 / dstTexture.Info.SamplesInX)),
+ (int)Math.Ceiling(dstScale * (dstY2 / dstTexture.Info.SamplesInY)));
bool linearFilter = control.UnpackLinearFilter();
@@ -107,10 +103,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
srcCopyTexture.Height++;
srcTexture = TextureManager.FindOrCreateTexture(srcCopyTexture, srcCopyTextureFormat, srcTexture.ScaleMode == TextureScaleMode.Scaled, srcHint);
- if (srcTexture.ScaleFactor != dstTexture.ScaleFactor)
- {
- srcTexture.PropagateScale(dstTexture);
- }
+ scale = srcTexture.ScaleFactor;
srcRegion = new Extents2D(
(int)Math.Ceiling(scale * ((srcX1 / srcTexture.Info.SamplesInX) - srcTexture.Info.Width)),