Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection

This commit is contained in:
gdkchan 2018-05-17 15:25:42 -03:00
parent 9b9ead94cd
commit b19c474082
28 changed files with 806 additions and 118 deletions

View file

@ -6,9 +6,15 @@ namespace Ryujinx.Graphics.Gal.Shader
{
private List<ShaderIrNode> Nodes;
private Dictionary<int, ShaderIrLabel> LabelsToInsert;
public int Position;
public ShaderIrBlock()
{
Nodes = new List<ShaderIrNode>();
LabelsToInsert = new Dictionary<int, ShaderIrLabel>();
}
public void AddNode(ShaderIrNode Node)
@ -16,6 +22,28 @@ namespace Ryujinx.Graphics.Gal.Shader
Nodes.Add(Node);
}
public ShaderIrLabel GetLabel(int Position)
{
if (LabelsToInsert.TryGetValue(Position, out ShaderIrLabel Label))
{
return Label;
}
Label = new ShaderIrLabel();
LabelsToInsert.Add(Position, Label);
return Label;
}
public void MarkLabel(int Position)
{
if (LabelsToInsert.TryGetValue(Position, out ShaderIrLabel Label))
{
Nodes.Add(Label);
}
}
public ShaderIrNode[] GetNodes()
{
return Nodes.ToArray();