aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Extents2D.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.GAL/Extents2D.cs')
-rw-r--r--Ryujinx.Graphics.GAL/Extents2D.cs13
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