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