summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-04-13 00:41:53 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:27 +0200
commit2597cee85b74be40bfecf0dc9cda90263d6cce40 (patch)
treefb128718fc6da4aa94aff121be577dd747115cb4 /src/shader_recompiler/ir_opt
parentshader: Implement geometry shaders (diff)
downloadyuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar.gz
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar.bz2
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar.lz
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar.xz
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.tar.zst
yuzu-2597cee85b74be40bfecf0dc9cda90263d6cce40.zip
Diffstat (limited to 'src/shader_recompiler/ir_opt')
-rw-r--r--src/shader_recompiler/ir_opt/constant_propagation_pass.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
index 61fbbe04c..ee73b5b60 100644
--- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
+++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp
@@ -422,6 +422,9 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
return FoldAdd<u32>(block, inst);
case IR::Opcode::ISub32:
return FoldISub32(inst);
+ case IR::Opcode::IMul32:
+ FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a * b; });
+ return;
case IR::Opcode::BitCastF32U32:
return FoldBitCast<IR::Opcode::BitCastF32U32, f32, u32>(inst, IR::Opcode::BitCastU32F32);
case IR::Opcode::BitCastU32F32:
@@ -479,6 +482,15 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
case IR::Opcode::INotEqual:
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a != b; });
return;
+ case IR::Opcode::BitwiseAnd32:
+ FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a & b; });
+ return;
+ case IR::Opcode::BitwiseOr32:
+ FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a | b; });
+ return;
+ case IR::Opcode::BitwiseXor32:
+ FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a ^ b; });
+ return;
case IR::Opcode::BitFieldUExtract:
FoldWhenAllImmediates(inst, [](u32 base, u32 shift, u32 count) {
if (static_cast<size_t>(shift) + static_cast<size_t>(count) > Common::BitSize<u32>()) {