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