From 9493cdfe553d77d8f37927ef2acf87cfbab1c467 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 20 Nov 2020 20:14:45 +0000 Subject: 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. --- Ryujinx.Graphics.GAL/Extents2D.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Ryujinx.Graphics.GAL/Extents2D.cs') diff --git a/Ryujinx.Graphics.GAL/Extents2D.cs b/Ryujinx.Graphics.GAL/Extents2D.cs index e9e26af4..05b0ce63 100644 --- a/Ryujinx.Graphics.GAL/Extents2D.cs +++ b/Ryujinx.Graphics.GAL/Extents2D.cs @@ -1,3 +1,5 @@ +using Ryujinx.Common; + namespace Ryujinx.Graphics.GAL { public struct Extents2D @@ -14,5 +16,16 @@ namespace Ryujinx.Graphics.GAL X2 = x2; Y2 = y2; } + + public Extents2D Reduce(int level) + { + int div = 1 << level; + + return new Extents2D( + X1 >> level, + Y1 >> level, + BitUtils.DivRoundUp(X2, div), + BitUtils.DivRoundUp(Y2, div)); + } } } \ No newline at end of file -- cgit v1.2.3