diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 2ce839059..4aa3682c2 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -203,7 +203,13 @@ void Precolor(EmitContext& ctx, const IR::Program& program) { | |||
| 203 | for (size_t i = 0; i < num_args; ++i) { | 203 | for (size_t i = 0; i < num_args; ++i) { |
| 204 | IR::Block& phi_block{*phi.PhiBlock(i)}; | 204 | IR::Block& phi_block{*phi.PhiBlock(i)}; |
| 205 | auto it{std::find_if_not(phi_block.rbegin(), phi_block.rend(), IsReference).base()}; | 205 | auto it{std::find_if_not(phi_block.rbegin(), phi_block.rend(), IsReference).base()}; |
| 206 | IR::IREmitter{phi_block, it}.PhiMove(phi, phi.Arg(i)); | 206 | IR::IREmitter ir{phi_block, it}; |
| 207 | const IR::Value arg{phi.Arg(i)}; | ||
| 208 | if (arg.IsImmediate()) { | ||
| 209 | ir.PhiMove(phi, arg); | ||
| 210 | } else { | ||
| 211 | ir.PhiMove(phi, IR::Value{&RegAlloc::AliasInst(*arg.Inst())}); | ||
| 212 | } | ||
| 207 | } | 213 | } |
| 208 | for (size_t i = 0; i < num_args; ++i) { | 214 | for (size_t i = 0; i < num_args; ++i) { |
| 209 | IR::IREmitter{*phi.PhiBlock(i)}.Reference(IR::Value{&phi}); | 215 | IR::IREmitter{*phi.PhiBlock(i)}.Reference(IR::Value{&phi}); |