summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-27 19:04:26 -0300
committerGravatar ameerj2021-07-22 21:51:34 -0400
commitfbf5cdcba0f3b03e8cd3019fb285a96037b05f26 (patch)
treecd880ac432ac309ef134e6b94544d0f2f8a47ab3 /src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
parentshader/exception: Fix compilation errors on gcc (diff)
downloadyuzu-fbf5cdcba0f3b03e8cd3019fb285a96037b05f26.tar.gz
yuzu-fbf5cdcba0f3b03e8cd3019fb285a96037b05f26.tar.xz
yuzu-fbf5cdcba0f3b03e8cd3019fb285a96037b05f26.zip
shader: Fix FSwizzleAdd folding when going through phi nodes
Diffstat (limited to 'src/shader_recompiler/ir_opt/constant_propagation_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/constant_propagation_pass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
index 66f1391db..796b4122d 100644
--- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
+++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
@@ -440,13 +440,13 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) {
440 // DPdxFine 440 // DPdxFine
441 if (index.U32() == 1) { 441 if (index.U32() == 1) {
442 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; 442 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
443 inst.ReplaceUsesWith(ir.DPdxFine(IR::F32{value_2})); 443 inst.ReplaceUsesWith(ir.DPdxFine(IR::F32{inst.Arg(1)}));
444 } 444 }
445 } else if (swizzle_value == 0xA5) { 445 } else if (swizzle_value == 0xA5) {
446 // DPdyFine 446 // DPdyFine
447 if (index.U32() == 2) { 447 if (index.U32() == 2) {
448 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; 448 IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
449 inst.ReplaceUsesWith(ir.DPdyFine(IR::F32{value_2})); 449 inst.ReplaceUsesWith(ir.DPdyFine(IR::F32{inst.Arg(1)}));
450 } 450 }
451 } 451 }
452} 452}