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.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp
index 0bf289f98..68a96cc79 100644
--- a/src/video_core/shader/ast.cpp
+++ b/src/video_core/shader/ast.cpp
@@ -372,13 +372,13 @@ ASTManager::~ASTManager() {
372void ASTManager::Init() { 372void ASTManager::Init() {
373 main_node = ASTBase::Make<ASTProgram>(ASTNode{}); 373 main_node = ASTBase::Make<ASTProgram>(ASTNode{});
374 program = std::get_if<ASTProgram>(main_node->GetInnerData()); 374 program = std::get_if<ASTProgram>(main_node->GetInnerData());
375 true_condition = MakeExpr<ExprBoolean>(true); 375 false_condition = MakeExpr<ExprBoolean>(false);
376} 376}
377 377
378ASTManager::ASTManager(ASTManager&& other) 378ASTManager::ASTManager(ASTManager&& other)
379 : labels_map(std::move(other.labels_map)), labels_count{other.labels_count}, 379 : 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}, 380 gotos(std::move(other.gotos)), labels(std::move(other.labels)), variables{other.variables},
381 program{other.program}, main_node{other.main_node}, true_condition{other.true_condition} { 381 program{other.program}, main_node{other.main_node}, false_condition{other.false_condition} {
382 other.main_node.reset(); 382 other.main_node.reset();
383} 383}
384 384
@@ -390,7 +390,7 @@ ASTManager& ASTManager::operator=(ASTManager&& other) {
390 variables = other.variables; 390 variables = other.variables;
391 program = other.program; 391 program = other.program;
392 main_node = other.main_node; 392 main_node = other.main_node;
393 true_condition = other.true_condition; 393 false_condition = other.false_condition;
394 394
395 other.main_node.reset(); 395 other.main_node.reset();
396 return *this; 396 return *this;
@@ -594,7 +594,7 @@ void ASTManager::MoveOutward(ASTNode goto_node) {
594 u32 var_index = NewVariable(); 594 u32 var_index = NewVariable();
595 Expr var_condition = MakeExpr<ExprVar>(var_index); 595 Expr var_condition = MakeExpr<ExprVar>(var_index);
596 ASTNode var_node = ASTBase::Make<ASTVarSet>(parent, var_index, condition); 596 ASTNode var_node = ASTBase::Make<ASTVarSet>(parent, var_index, condition);
597 ASTNode var_node_init = ASTBase::Make<ASTVarSet>(parent, var_index, true_condition); 597 ASTNode var_node_init = ASTBase::Make<ASTVarSet>(parent, var_index, false_condition);
598 zipper2.InsertBefore(var_node_init, parent); 598 zipper2.InsertBefore(var_node_init, parent);
599 zipper.InsertAfter(var_node, prev); 599 zipper.InsertAfter(var_node, prev);
600 goto_node->SetGotoCondition(var_condition); 600 goto_node->SetGotoCondition(var_condition);
@@ -605,7 +605,7 @@ void ASTManager::MoveOutward(ASTNode goto_node) {
605 u32 var_index = NewVariable(); 605 u32 var_index = NewVariable();
606 Expr var_condition = MakeExpr<ExprVar>(var_index); 606 Expr var_condition = MakeExpr<ExprVar>(var_index);
607 ASTNode var_node = ASTBase::Make<ASTVarSet>(parent, var_index, condition); 607 ASTNode var_node = ASTBase::Make<ASTVarSet>(parent, var_index, condition);
608 ASTNode var_node_init = ASTBase::Make<ASTVarSet>(parent, var_index, true_condition); 608 ASTNode var_node_init = ASTBase::Make<ASTVarSet>(parent, var_index, false_condition);
609 if (is_if) { 609 if (is_if) {
610 zipper2.InsertBefore(var_node_init, parent); 610 zipper2.InsertBefore(var_node_init, parent);
611 } else { 611 } else {