summaryrefslogtreecommitdiff
path: root/src/video_core/shader/ast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/shader/ast.cpp')
-rw-r--r--src/video_core/shader/ast.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp
index 74b9a8f9a..7e5e916ab 100644
--- a/src/video_core/shader/ast.cpp
+++ b/src/video_core/shader/ast.cpp
@@ -363,7 +363,8 @@ std::string ASTManager::Print() {
363 return printer.GetResult(); 363 return printer.GetResult();
364} 364}
365 365
366ASTManager::ASTManager(bool full_decompile) : full_decompile{full_decompile} {}; 366ASTManager::ASTManager(bool full_decompile, bool disable_else_derivation)
367 : full_decompile{full_decompile}, disable_else_derivation{disable_else_derivation} {};
367 368
368ASTManager::~ASTManager() { 369ASTManager::~ASTManager() {
369 Clear(); 370 Clear();
@@ -378,7 +379,8 @@ void ASTManager::Init() {
378ASTManager::ASTManager(ASTManager&& other) 379ASTManager::ASTManager(ASTManager&& other)
379 : labels_map(std::move(other.labels_map)), labels_count{other.labels_count}, 380 : labels_map(std::move(other.labels_map)), labels_count{other.labels_count},
380 gotos(std::move(other.gotos)), labels(std::move(other.labels)), variables{other.variables}, 381 gotos(std::move(other.gotos)), labels(std::move(other.labels)), variables{other.variables},
381 program{other.program}, main_node{other.main_node}, false_condition{other.false_condition} { 382 program{other.program}, main_node{other.main_node}, false_condition{other.false_condition},
383 disable_else_derivation{other.disable_else_derivation} {
382 other.main_node.reset(); 384 other.main_node.reset();
383} 385}
384 386
@@ -392,6 +394,7 @@ ASTManager& ASTManager::operator=(ASTManager&& other) {
392 program = other.program; 394 program = other.program;
393 main_node = other.main_node; 395 main_node = other.main_node;
394 false_condition = other.false_condition; 396 false_condition = other.false_condition;
397 disable_else_derivation = other.disable_else_derivation;
395 398
396 other.main_node.reset(); 399 other.main_node.reset();
397 return *this; 400 return *this;
@@ -641,7 +644,7 @@ void ASTManager::EncloseIfThen(ASTNode goto_node, ASTNode label) {
641 ASTNode prev = goto_node->GetPrevious(); 644 ASTNode prev = goto_node->GetPrevious();
642 Expr condition = goto_node->GetGotoCondition(); 645 Expr condition = goto_node->GetGotoCondition();
643 bool do_else = false; 646 bool do_else = false;
644 if (prev->IsIfThen()) { 647 if (!disable_else_derivation && prev->IsIfThen()) {
645 Expr if_condition = prev->GetIfCondition(); 648 Expr if_condition = prev->GetIfCondition();
646 do_else = ExprAreEqual(if_condition, condition); 649 do_else = ExprAreEqual(if_condition, condition);
647 } 650 }