summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/ast.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-21 03:12:06 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-10-05 00:52:52 +0200
commit2e9a810423ef36178ac3947f8feeb7b9a5b29bce (patch)
treecad196eab22eafd8766a51e7086b8812e510b1c6 /src/video_core/shader/ast.cpp
parentvk_shader_compiler: Implement the decompiler in SPIR-V (diff)
downloadyuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar.gz
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar.bz2
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar.lz
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar.xz
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.tar.zst
yuzu-2e9a810423ef36178ac3947f8feeb7b9a5b29bce.zip
Diffstat (limited to '')
-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() {
return printer.GetResult();
}
-ASTManager::ASTManager(bool full_decompile) : full_decompile{full_decompile} {};
+ASTManager::ASTManager(bool full_decompile, bool disable_else_derivation)
+ : full_decompile{full_decompile}, disable_else_derivation{disable_else_derivation} {};
ASTManager::~ASTManager() {
Clear();
@@ -378,7 +379,8 @@ void ASTManager::Init() {
ASTManager::ASTManager(ASTManager&& other)
: labels_map(std::move(other.labels_map)), labels_count{other.labels_count},
gotos(std::move(other.gotos)), labels(std::move(other.labels)), variables{other.variables},
- program{other.program}, main_node{other.main_node}, false_condition{other.false_condition} {
+ program{other.program}, main_node{other.main_node}, false_condition{other.false_condition},
+ disable_else_derivation{other.disable_else_derivation} {
other.main_node.reset();
}
@@ -392,6 +394,7 @@ ASTManager& ASTManager::operator=(ASTManager&& other) {
program = other.program;
main_node = other.main_node;
false_condition = other.false_condition;
+ disable_else_derivation = other.disable_else_derivation;
other.main_node.reset();
return *this;
@@ -641,7 +644,7 @@ void ASTManager::EncloseIfThen(ASTNode goto_node, ASTNode label) {
ASTNode prev = goto_node->GetPrevious();
Expr condition = goto_node->GetGotoCondition();
bool do_else = false;
- if (prev->IsIfThen()) {
+ if (!disable_else_derivation && prev->IsIfThen()) {
Expr if_condition = prev->GetIfCondition();
do_else = ExprAreEqual(if_condition, condition);
}