diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp index 9fa912ed8..dab6d68c0 100644 --- a/src/shader_recompiler/frontend/maxwell/program.cpp +++ b/src/shader_recompiler/frontend/maxwell/program.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "shader_recompiler/frontend/ir/basic_block.h" | 9 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 10 | #include "shader_recompiler/frontend/ir/post_order.h" | ||
| 10 | #include "shader_recompiler/frontend/ir/structured_control_flow.h" | 11 | #include "shader_recompiler/frontend/ir/structured_control_flow.h" |
| 11 | #include "shader_recompiler/frontend/maxwell/program.h" | 12 | #include "shader_recompiler/frontend/maxwell/program.h" |
| 12 | #include "shader_recompiler/frontend/maxwell/translate/translate.h" | 13 | #include "shader_recompiler/frontend/maxwell/translate/translate.h" |
| @@ -56,11 +57,14 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo | |||
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | fmt::print(stdout, "No optimizations: {}", IR::DumpProgram(program)); | 59 | fmt::print(stdout, "No optimizations: {}", IR::DumpProgram(program)); |
| 59 | std::ranges::for_each(functions, Optimization::SsaRewritePass); | ||
| 60 | for (IR::Function& function : functions) { | 60 | for (IR::Function& function : functions) { |
| 61 | Optimization::Invoke(Optimization::GlobalMemoryToStorageBufferPass, function); | 61 | function.post_order_blocks = PostOrder(function.blocks); |
| 62 | Optimization::Invoke(Optimization::ConstantPropagationPass, function); | 62 | Optimization::SsaRewritePass(function.post_order_blocks); |
| 63 | Optimization::Invoke(Optimization::DeadCodeEliminationPass, function); | 63 | } |
| 64 | for (IR::Function& function : functions) { | ||
| 65 | Optimization::PostOrderInvoke(Optimization::GlobalMemoryToStorageBufferPass, function); | ||
| 66 | Optimization::PostOrderInvoke(Optimization::ConstantPropagationPass, function); | ||
| 67 | Optimization::PostOrderInvoke(Optimization::DeadCodeEliminationPass, function); | ||
| 64 | Optimization::IdentityRemovalPass(function); | 68 | Optimization::IdentityRemovalPass(function); |
| 65 | Optimization::VerificationPass(function); | 69 | Optimization::VerificationPass(function); |
| 66 | } | 70 | } |