diff options
| author | gdk <gab.dark.100@gmail.com> | 2019-10-13 03:02:07 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 1876b346fea647e8284a66bb6d62c38801035cff (patch) | |
| tree | 6eeff094298cda84d1613dc5ec0691e51d7b35f1 /Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs | |
| parent | f617fb542a0e3d36012d77a4b5acbde7b08902f2 (diff) | |
Initial work
Diffstat (limited to 'Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs')
| -rw-r--r-- | Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs b/Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs deleted file mode 100644 index 10d5dce0..00000000 --- a/Ryujinx.Graphics/Shader/StructuredIr/AstBlockVisitor.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; - -using static Ryujinx.Graphics.Shader.StructuredIr.AstHelper; - -namespace Ryujinx.Graphics.Shader.StructuredIr -{ - class AstBlockVisitor - { - public AstBlock Block { get; private set; } - - public class BlockVisitationEventArgs : EventArgs - { - public AstBlock Block { get; } - - public BlockVisitationEventArgs(AstBlock block) - { - Block = block; - } - } - - public event EventHandler<BlockVisitationEventArgs> BlockEntered; - public event EventHandler<BlockVisitationEventArgs> BlockLeft; - - public AstBlockVisitor(AstBlock mainBlock) - { - Block = mainBlock; - } - - public IEnumerable<IAstNode> Visit() - { - IAstNode node = Block.First; - - while (node != null) - { - // We reached a child block, visit the nodes inside. - while (node is AstBlock childBlock) - { - Block = childBlock; - - node = childBlock.First; - - BlockEntered?.Invoke(this, new BlockVisitationEventArgs(Block)); - } - - // Node may be null, if the block is empty. - if (node != null) - { - IAstNode next = Next(node); - - yield return node; - - node = next; - } - - // We reached the end of the list, go up on tree to the parent blocks. - while (node == null && Block.Type != AstBlockType.Main) - { - BlockLeft?.Invoke(this, new BlockVisitationEventArgs(Block)); - - node = Next(Block); - - Block = Block.Parent; - } - } - } - } -}
\ No newline at end of file |
