summaryrefslogtreecommitdiff
path: root/src/video_core/shader/ast.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-08-21 11:54:47 -0400
committerGravatar FernandoS272019-10-04 18:52:51 -0400
commit0366c18d87f8c60ff6a99db668a7f2d810aaeeb0 (patch)
treefa1731f7cb9285ffe40f789447b528262edd618f /src/video_core/shader/ast.h
parentShader_Ir: Refactor Decompilation process and allow multiple decompilation mo... (diff)
downloadyuzu-0366c18d87f8c60ff6a99db668a7f2d810aaeeb0.tar.gz
yuzu-0366c18d87f8c60ff6a99db668a7f2d810aaeeb0.tar.xz
yuzu-0366c18d87f8c60ff6a99db668a7f2d810aaeeb0.zip
Shader_IR: mark labels as unused for partial decompile.
Diffstat (limited to 'src/video_core/shader/ast.h')
-rw-r--r--src/video_core/shader/ast.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h
index 849d0612c..07deb58e4 100644
--- a/src/video_core/shader/ast.h
+++ b/src/video_core/shader/ast.h
@@ -112,6 +112,7 @@ class ASTLabel {
112public: 112public:
113 ASTLabel(u32 index) : index{index} {} 113 ASTLabel(u32 index) : index{index} {}
114 u32 index; 114 u32 index;
115 bool unused{};
115}; 116};
116 117
117class ASTGoto { 118class ASTGoto {
@@ -204,6 +205,13 @@ public:
204 return nullptr; 205 return nullptr;
205 } 206 }
206 207
208 void MarkLabelUnused() const {
209 auto inner = std::get_if<ASTLabel>(&data);
210 if (inner) {
211 inner->unused = true;
212 }
213 }
214
207 Expr GetIfCondition() const { 215 Expr GetIfCondition() const {
208 auto inner = std::get_if<ASTIfThen>(&data); 216 auto inner = std::get_if<ASTIfThen>(&data);
209 if (inner) { 217 if (inner) {