2018-04-08 20:17:35 +01:00
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
|
|
{
|
|
|
|
class ShaderIrOperGpr : ShaderIrNode
|
|
|
|
{
|
|
|
|
public const int ZRIndex = 0xff;
|
|
|
|
|
|
|
|
public bool IsConst => Index == ZRIndex;
|
|
|
|
|
2019-01-31 12:43:24 +00:00
|
|
|
public bool IsValidRegister => (uint)Index <= ZRIndex;
|
2018-08-21 03:31:10 +01: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 20:17:35 +01:00
|
|
|
|
|
|
|
public ShaderIrOperGpr(int Index)
|
|
|
|
{
|
|
|
|
this.Index = Index;
|
2019-01-31 12:43:24 +00:00
|
|
|
|
|
|
|
RegisterSize = ShaderRegisterSize.Single;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ShaderIrOperGpr(int Index, int HalfPart)
|
|
|
|
{
|
|
|
|
this.Index = Index;
|
|
|
|
this.HalfPart = HalfPart;
|
|
|
|
|
|
|
|
RegisterSize = ShaderRegisterSize.Half;
|
2018-04-08 20:17:35 +01:00
|
|
|
}
|
2018-08-21 03:31:10 +01:00
|
|
|
|
|
|
|
public static ShaderIrOperGpr MakeTemporary(int Index = 0)
|
|
|
|
{
|
|
|
|
return new ShaderIrOperGpr(0x100 + Index);
|
|
|
|
}
|
2018-04-08 20:17:35 +01:00
|
|
|
}
|
|
|
|
}
|