2018-04-08 19:17:35 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.Shader
|
|
|
|
{
|
|
|
|
class ShaderIrBlock
|
|
|
|
{
|
2018-09-18 04:30:35 +00:00
|
|
|
public int Position { get; set; }
|
|
|
|
public int EndPosition { get; set; }
|
2018-04-08 19:17:35 +00:00
|
|
|
|
2018-05-29 23:37:10 +00:00
|
|
|
public ShaderIrBlock Next { get; set; }
|
|
|
|
public ShaderIrBlock Branch { get; set; }
|
2018-05-17 18:25:42 +00:00
|
|
|
|
2018-05-29 23:37:10 +00:00
|
|
|
public List<ShaderIrBlock> Sources { get; private set; }
|
2018-05-17 18:25:42 +00:00
|
|
|
|
2018-05-29 23:37:10 +00:00
|
|
|
public List<ShaderIrNode> Nodes { get; private set; }
|
2018-05-17 18:25:42 +00:00
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public ShaderIrBlock(int position)
|
2018-04-08 19:17:35 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
Position = position;
|
2018-04-08 19:17:35 +00:00
|
|
|
|
2018-05-29 23:37:10 +00:00
|
|
|
Sources = new List<ShaderIrBlock>();
|
2018-05-17 18:25:42 +00:00
|
|
|
|
2018-05-29 23:37:10 +00:00
|
|
|
Nodes = new List<ShaderIrNode>();
|
2018-05-17 18:25:42 +00:00
|
|
|
}
|
|
|
|
|
2019-03-04 01:45:25 +00:00
|
|
|
public void AddNode(ShaderIrNode node)
|
2018-05-17 18:25:42 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
Nodes.Add(node);
|
2018-05-17 18:25:42 +00:00
|
|
|
}
|
|
|
|
|
2018-04-08 19:17:35 +00:00
|
|
|
public ShaderIrNode[] GetNodes()
|
|
|
|
{
|
|
|
|
return Nodes.ToArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ShaderIrNode GetLastNode()
|
|
|
|
{
|
|
|
|
if (Nodes.Count > 0)
|
|
|
|
{
|
|
|
|
return Nodes[Nodes.Count - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|