diff options
Diffstat (limited to 'Ryujinx.Graphics.Shader/Decoders/Block.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/Decoders/Block.cs | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Decoders/Block.cs b/Ryujinx.Graphics.Shader/Decoders/Block.cs index e1470237..69cb55b9 100644 --- a/Ryujinx.Graphics.Shader/Decoders/Block.cs +++ b/Ryujinx.Graphics.Shader/Decoders/Block.cs @@ -8,10 +8,38 @@ namespace Ryujinx.Graphics.Shader.Decoders public ulong Address { get; set; } public ulong EndAddress { get; set; } - public Block Next { get; set; } - public Block Branch { get; set; } + private Block _next; + private Block _branch; - public OpCodeBranchIndir BrIndir { get; set; } + public Block Next + { + get + { + return _next; + } + set + { + _next?.Predecessors.Remove(this); + value?.Predecessors.Add(this); + _next = value; + } + } + + public Block Branch + { + get + { + return _branch; + } + set + { + _branch?.Predecessors.Remove(this); + value?.Predecessors.Add(this); + _branch = value; + } + } + + public HashSet<Block> Predecessors { get; } public List<OpCode> OpCodes { get; } public List<OpCodePush> PushOpCodes { get; } @@ -20,6 +48,8 @@ namespace Ryujinx.Graphics.Shader.Decoders { Address = address; + Predecessors = new HashSet<Block>(); + OpCodes = new List<OpCode>(); PushOpCodes = new List<OpCodePush>(); } |