diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-03-30 08:19:50 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:25 +0200 |
commit | 514a6b07eedace58b4a0c95282bdfc729623d1d9 (patch) | |
tree | b384c882fa5e24ce9a0a2d287076d23949b3e266 /src/shader_recompiler/frontend | |
parent | shader: Fix indirect branches to scheduler instructions (diff) | |
download | yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar.gz yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar.bz2 yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar.lz yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar.xz yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.tar.zst yuzu-514a6b07eedace58b4a0c95282bdfc729623d1d9.zip |
Diffstat (limited to 'src/shader_recompiler/frontend')
-rw-r--r-- | src/shader_recompiler/frontend/ir/microinstruction.cpp | 4 | ||||
-rw-r--r-- | src/shader_recompiler/frontend/ir/value.cpp | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/ir/microinstruction.cpp b/src/shader_recompiler/frontend/ir/microinstruction.cpp index c3ba6b522..074c71d53 100644 --- a/src/shader_recompiler/frontend/ir/microinstruction.cpp +++ b/src/shader_recompiler/frontend/ir/microinstruction.cpp @@ -193,6 +193,10 @@ void Inst::AddPhiOperand(Block* predecessor, const Value& value) { if (!value.IsImmediate()) { Use(value); } + if (Flags<IR::Type>() == IR::Type::Void) { + // Set the type of the phi node + SetFlags<IR::Type>(value.Type()); + } phi_args.emplace_back(predecessor, value); } diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp index e8e4662e7..837c1b487 100644 --- a/src/shader_recompiler/frontend/ir/value.cpp +++ b/src/shader_recompiler/frontend/ir/value.cpp @@ -56,7 +56,11 @@ bool Value::IsLabel() const noexcept { } IR::Type Value::Type() const noexcept { - if (IsIdentity() || IsPhi()) { + if (IsPhi()) { + // The type of a phi node is stored in its flags + return inst->Flags<IR::Type>(); + } + if (IsIdentity()) { return inst->Arg(0).Type(); } if (type == Type::Opaque) { |