summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-08-24 02:00:11 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-08-30 17:46:24 +0200
commit4fda7f1c821e1000210b1dfdf1074795b1aa9d96 (patch)
tree1bc899e56f66fa8c6a9ebe6fbade73c2dc3ddd4a /src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
parentstructured_control_flow: Add DemoteCombinationPass (diff)
downloadyuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar.gz
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar.bz2
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar.lz
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar.xz
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.tar.zst
yuzu-4fda7f1c821e1000210b1dfdf1074795b1aa9d96.zip
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
index f124dc8c0..77d1cd0fc 100644
--- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp
@@ -20,6 +20,7 @@
#include "shader_recompiler/frontend/maxwell/decode.h"
#include "shader_recompiler/frontend/maxwell/structured_control_flow.h"
#include "shader_recompiler/frontend/maxwell/translate/translate.h"
+#include "shader_recompiler/host_translate_info.h"
#include "shader_recompiler/object_pool.h"
namespace Shader::Maxwell {
@@ -652,7 +653,7 @@ class TranslatePass {
public:
TranslatePass(ObjectPool<IR::Inst>& inst_pool_, ObjectPool<IR::Block>& block_pool_,
ObjectPool<Statement>& stmt_pool_, Environment& env_, Statement& root_stmt,
- IR::AbstractSyntaxList& syntax_list_)
+ IR::AbstractSyntaxList& syntax_list_, const HostTranslateInfo& host_info)
: stmt_pool{stmt_pool_}, inst_pool{inst_pool_}, block_pool{block_pool_}, env{env_},
syntax_list{syntax_list_} {
Visit(root_stmt, nullptr, nullptr);
@@ -660,7 +661,7 @@ public:
IR::Block& first_block{*syntax_list.front().data.block};
IR::IREmitter ir(first_block, first_block.begin());
ir.Prologue();
- if (uses_demote_to_helper) {
+ if (uses_demote_to_helper && host_info.needs_demote_reorder) {
DemoteCombinationPass();
}
}
@@ -977,12 +978,13 @@ private:
} // Anonymous namespace
IR::AbstractSyntaxList BuildASL(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Block>& block_pool,
- Environment& env, Flow::CFG& cfg) {
+ Environment& env, Flow::CFG& cfg,
+ const HostTranslateInfo& host_info) {
ObjectPool<Statement> stmt_pool{64};
GotoPass goto_pass{cfg, stmt_pool};
Statement& root{goto_pass.RootStatement()};
IR::AbstractSyntaxList syntax_list;
- TranslatePass{inst_pool, block_pool, stmt_pool, env, root, syntax_list};
+ TranslatePass{inst_pool, block_pool, stmt_pool, env, root, syntax_list, host_info};
return syntax_list;
}