diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-29 02:54:21 +0200 |
---|---|---|
committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-10-05 00:52:48 +0200 |
commit | 8be6e1c5221066a49b6ad27efbd20a999a7c16b3 (patch) | |
tree | a00263eb962503bec08ec4bc870a9546c3b80d22 /src/video_core/shader/control_flow.cpp | |
parent | shader_ir: Add basic goto elimination (diff) | |
download | yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar.gz yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar.bz2 yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar.lz yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar.xz yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.tar.zst yuzu-8be6e1c5221066a49b6ad27efbd20a999a7c16b3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/control_flow.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index bea7f767c..7a21d870f 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp @@ -423,7 +423,16 @@ void InsertBranch(ASTManager& mm, const BlockBranchInfo& branch) { result = MakeExpr<ExprCondCode>(cond.cc); } if (cond.predicate != Pred::UnusedIndex) { - Expr extra = MakeExpr<ExprPredicate>(cond.predicate); + u32 pred = static_cast<u32>(cond.predicate); + bool negate; + if (pred > 7) { + negate = true; + pred -= 8; + } + Expr extra = MakeExpr<ExprPredicate>(pred); + if (negate) { + extra = MakeExpr<ExprNot>(extra); + } if (result) { return MakeExpr<ExprAnd>(extra, result); } @@ -460,8 +469,9 @@ void DecompileShader(CFGRebuildState& state) { InsertBranch(manager, block.branch); } } + //manager.ShowCurrentState("Before Decompiling"); manager.Decompile(); - LOG_CRITICAL(HW_GPU, "Decompiled Shader:\n{} \n", manager.Print()); + //manager.ShowCurrentState("After Decompiling"); } std::optional<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code, |