aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/StructuredIr/GotoStatement.cs
blob: 25216e55fb23731ba51488acc2d2489f1267db9b (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;
        }
    }
}