aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/StructuredIr/GotoStatement.cs
blob: 4607a16c1275da47196134869c88c232a2e2690b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Ryujinx.Graphics.Shader.IntermediateRepresentation;

namespace Ryujinx.Graphics.Shader.StructuredIr
{
    class GotoStatement
    {
        public AstOperation Goto { get; }
        public AstAssignment Label { get; }

        public IAstNode Condition => Label.Destination;

        public bool IsLoop { get; set; }

        public bool IsUnconditional => Goto.Inst == Instruction.Branch;

        public GotoStatement(AstOperation branch, AstAssignment label, bool isLoop)
        {
            Goto = branch;
            Label = label;
            IsLoop = isLoop;
        }
    }
}