diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-08-25 21:32:00 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-05 00:52:51 +0200 |
commit | ca9901867e91cd0be0cc75094ee8ea2fb2767c47 (patch) | |
tree | 1d46ef166d33459447a006f3da3dd663fab4fcaa /src/video_core/shader/ast.h | |
parent | Shader_IR: mark labels as unused for partial decompile. (diff) | |
download | yuzu-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 '')
-rw-r--r-- | src/video_core/shader/ast.h | 22 |
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; |