2018-04-08 19:17:35 +00:00
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
|
|
{
|
|
|
|
class ShaderIrOperGpr : ShaderIrNode
|
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
public const int ZrIndex = 0xff;
|
2018-04-08 19:17:35 +00:00
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public bool IsConst => Index == ZrIndex;
|
2018-04-08 19:17:35 +00:00
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public bool IsValidRegister => (uint)Index <= ZrIndex;
|
2018-08-21 02:31:10 +00:00
|
|
|
|
2019-01-31 12:43:24 +00:00
|
|
|
public int Index { get; set; }
|
|
|
|
public int HalfPart { get; set; }
|
|
|
|
|
|
|
|
public ShaderRegisterSize RegisterSize { get; private set; }
|
2018-04-08 19:17:35 +00:00
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public ShaderIrOperGpr(int index)
|
2018-04-08 19:17:35 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
Index = index;
|
2019-01-31 12:43:24 +00:00
|
|
|
|
|
|
|
RegisterSize = ShaderRegisterSize.Single;
|
|
|
|
}
|
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public ShaderIrOperGpr(int index, int halfPart)
|
2019-01-31 12:43:24 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
Index = index;
|
|
|
|
HalfPart = halfPart;
|
2019-01-31 12:43:24 +00:00
|
|
|
|
|
|
|
RegisterSize = ShaderRegisterSize.Half;
|
2018-04-08 19:17:35 +00:00
|
|
|
}
|
2018-08-21 02:31:10 +00:00
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public static ShaderIrOperGpr MakeTemporary(int index = 0)
|
2018-08-21 02:31:10 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
return new ShaderIrOperGpr(0x100 + index);
|
2018-08-21 02:31:10 +00:00
|
|
|
}
|
2018-04-08 19:17:35 +00:00
|
|
|
}
|
|
|
|
}
|