diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-11-20 20:14:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-20 17:14:45 -0300 |
| commit | 9493cdfe553d77d8f37927ef2acf87cfbab1c467 (patch) | |
| tree | 9c5e5b588c1fa9372274d3d780b4cbb041bf24c5 /Ryujinx.Graphics.GAL | |
| parent | cf7044e37bc628f25525941d25b830594b833428 (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.GAL')
| -rw-r--r-- | Ryujinx.Graphics.GAL/Extents2D.cs | 13 |
1 files changed, 13 insertions, 0 deletions
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 |
