/ src / Ryujinx.Graphics.GAL / Extents2D.cs
Extents2D.cs
 1  using Ryujinx.Common;
 2  
 3  namespace Ryujinx.Graphics.GAL
 4  {
 5      public readonly struct Extents2D
 6      {
 7          public int X1 { get; }
 8          public int Y1 { get; }
 9          public int X2 { get; }
10          public int Y2 { get; }
11  
12          public Extents2D(int x1, int y1, int x2, int y2)
13          {
14              X1 = x1;
15              Y1 = y1;
16              X2 = x2;
17              Y2 = y2;
18          }
19  
20          public Extents2D Reduce(int level)
21          {
22              int div = 1 << level;
23  
24              return new Extents2D(
25                  X1 >> level,
26                  Y1 >> level,
27                  BitUtils.DivRoundUp(X2, div),
28                  BitUtils.DivRoundUp(Y2, div));
29          }
30      }
31  }