From b19c4740823ed8fcebf62bf5741a7614a2ac0aa0 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 17 May 2018 15:25:42 -0300 Subject: Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection --- Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Ryujinx.Graphics/Gal/Shader/ShaderIrBlock.cs') 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 Nodes; + private Dictionary LabelsToInsert; + + public int Position; + public ShaderIrBlock() { Nodes = new List(); + + LabelsToInsert = new Dictionary(); } 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(); -- cgit v1.2.3