2018-04-08 15:17:35 -04:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
|
|
{
|
|
|
|
class ShaderIrBlock
|
|
|
|
{
|
2018-05-29 19:37:10 -04:00
|
|
|
public long Position { get; set; }
|
|
|
|
public long EndPosition { get; set; }
|
2018-04-08 15:17:35 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
public ShaderIrBlock Next { get; set; }
|
|
|
|
public ShaderIrBlock Branch { get; set; }
|
2018-05-17 14:25:42 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
public List<ShaderIrBlock> Sources { get; private set; }
|
2018-05-17 14:25:42 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
public List<ShaderIrNode> Nodes { get; private set; }
|
2018-05-17 14:25:42 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
public ShaderIrBlock(long Position)
|
2018-04-08 15:17:35 -04:00
|
|
|
{
|
2018-05-29 19:37:10 -04:00
|
|
|
this.Position = Position;
|
2018-04-08 15:17:35 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
Sources = new List<ShaderIrBlock>();
|
2018-05-17 14:25:42 -04:00
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
Nodes = new List<ShaderIrNode>();
|
2018-05-17 14:25:42 -04:00
|
|
|
}
|
|
|
|
|
2018-05-29 19:37:10 -04:00
|
|
|
public void AddNode(ShaderIrNode Node)
|
2018-05-17 14:25:42 -04:00
|
|
|
{
|
2018-05-29 19:37:10 -04:00
|
|
|
Nodes.Add(Node);
|
2018-05-17 14:25:42 -04:00
|
|
|
}
|
|
|
|
|
2018-04-08 15:17:35 -04:00
|
|
|
public ShaderIrNode[] GetNodes()
|
|
|
|
{
|
|
|
|
return Nodes.ToArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ShaderIrNode GetLastNode()
|
|
|
|
{
|
|
|
|
if (Nodes.Count > 0)
|
|
|
|
{
|
|
|
|
return Nodes[Nodes.Count - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|