summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-08-25 21:32:00 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-05 00:52:51 +0200
commitca9901867e91cd0be0cc75094ee8ea2fb2767c47 (patch)
tree1d46ef166d33459447a006f3da3dd663fab4fcaa /src/video_core/shader
parentShader_IR: mark labels as unused for partial decompile. (diff)
downloadyuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar.gz
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar.bz2
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar.lz
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar.xz
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.tar.zst
yuzu-ca9901867e91cd0be0cc75094ee8ea2fb2767c47.zip
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();
}