summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/shader/ast.h')
-rw-r--r--src/video_core/shader/ast.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h
index 07deb58e4..12db336df 100644
--- a/src/video_core/shader/ast.h
+++ b/src/video_core/shader/ast.h
@@ -205,13 +205,29 @@ public:
return nullptr;
}
- void MarkLabelUnused() const {
+ void MarkLabelUnused() {
auto inner = std::get_if<ASTLabel>(&data);
if (inner) {
inner->unused = true;
}
}
+ bool IsLabelUnused() const {
+ auto inner = std::get_if<ASTLabel>(&data);
+ if (inner) {
+ return inner->unused;
+ }
+ return true;
+ }
+
+ u32 GetLabelIndex() const {
+ auto inner = std::get_if<ASTLabel>(&data);
+ if (inner) {
+ return inner->index;
+ }
+ return -1;
+ }
+
Expr GetIfCondition() const {
auto inner = std::get_if<ASTIfThen>(&data);
if (inner) {
@@ -336,6 +352,10 @@ public:
return variables;
}
+ const std::vector<ASTNode>& GetLabels() const {
+ return labels;
+ }
+
private:
bool IsBackwardsJump(ASTNode goto_node, ASTNode label_node) const;