aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-05-17 15:25:42 -0300
committergdkchan <gab.dark.100@gmail.com>2018-05-17 15:25:42 -0300
commitb19c4740823ed8fcebf62bf5741a7614a2ac0aa0 (patch)
tree8cdede3fdb90aa35ffe50c004559b80d4704bea3 /Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs
parent9b9ead94cd2f25a85468ecf91b7898bf34e10825 (diff)
Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection
Diffstat (limited to 'Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs')
-rw-r--r--Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs b/Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs
index c920d9fa..5f365d8c 100644
--- a/Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs
+++ b/Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs
@@ -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();