summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/shader')
-rw-r--r--src/video_core/shader/ast.h22
-rw-r--r--src/video_core/shader/shader_ir.h4
2 files changed, 25 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;
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index 7a91c9bb6..105981d67 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -151,6 +151,10 @@ public:
return decompiled;
}
+ const ASTManager& GetASTManager() const {
+ return program_manager;
+ }
+
ASTNode GetASTProgram() const {
return program_manager.GetProgram();
}