2020-11-20 13:14:45 -07:00
|
|
|
using Ryujinx.Common;
|
|
|
|
|
2019-10-13 00:02:07 -06:00
|
|
|
namespace Ryujinx.Graphics.GAL
|
|
|
|
{
|
2022-12-05 06:47:39 -07:00
|
|
|
public readonly struct Extents2D
|
2019-10-13 00:02:07 -06:00
|
|
|
{
|
|
|
|
public int X1 { get; }
|
|
|
|
public int Y1 { get; }
|
|
|
|
public int X2 { get; }
|
|
|
|
public int Y2 { get; }
|
|
|
|
|
|
|
|
public Extents2D(int x1, int y1, int x2, int y2)
|
|
|
|
{
|
|
|
|
X1 = x1;
|
|
|
|
Y1 = y1;
|
|
|
|
X2 = x2;
|
|
|
|
Y2 = y2;
|
|
|
|
}
|
2020-11-20 13:14:45 -07:00
|
|
|
|
|
|
|
public Extents2D Reduce(int level)
|
|
|
|
{
|
|
|
|
int div = 1 << level;
|
|
|
|
|
|
|
|
return new Extents2D(
|
|
|
|
X1 >> level,
|
|
|
|
Y1 >> level,
|
|
|
|
BitUtils.DivRoundUp(X2, div),
|
|
|
|
BitUtils.DivRoundUp(Y2, div));
|
|
|
|
}
|
2019-10-13 00:02:07 -06:00
|
|
|
}
|
|
|
|
}
|