diff options
| author | 2021-03-14 03:41:05 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:23 -0400 | |
| commit | 71f96fa6366dc6dd306a953bca1b958fb32bc55a (patch) | |
| tree | 12e13f9502e4b9510446c967a831e5d4bacb729e /src/shader_recompiler/frontend/ir/program.cpp | |
| parent | spirv: Add SignedZeroInfNanPreserve logic (diff) | |
| download | yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.gz yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.xz yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.zip | |
shader: Implement CAL inlining function calls
Diffstat (limited to 'src/shader_recompiler/frontend/ir/program.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/program.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/shader_recompiler/frontend/ir/program.cpp b/src/shader_recompiler/frontend/ir/program.cpp index 8c301c3a1..5f51aeb5f 100644 --- a/src/shader_recompiler/frontend/ir/program.cpp +++ b/src/shader_recompiler/frontend/ir/program.cpp | |||
| @@ -9,7 +9,8 @@ | |||
| 9 | 9 | ||
| 10 | #include <fmt/format.h> | 10 | #include <fmt/format.h> |
| 11 | 11 | ||
| 12 | #include "shader_recompiler/frontend/ir/function.h" | 12 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 13 | #include "shader_recompiler/frontend/ir/microinstruction.h" | ||
| 13 | #include "shader_recompiler/frontend/ir/program.h" | 14 | #include "shader_recompiler/frontend/ir/program.h" |
| 14 | 15 | ||
| 15 | namespace Shader::IR { | 16 | namespace Shader::IR { |
| @@ -19,18 +20,13 @@ std::string DumpProgram(const Program& program) { | |||
| 19 | std::map<const IR::Inst*, size_t> inst_to_index; | 20 | std::map<const IR::Inst*, size_t> inst_to_index; |
| 20 | std::map<const IR::Block*, size_t> block_to_index; | 21 | std::map<const IR::Block*, size_t> block_to_index; |
| 21 | 22 | ||
| 22 | for (const IR::Function& function : program.functions) { | 23 | for (const IR::Block* const block : program.blocks) { |
| 23 | for (const IR::Block* const block : function.blocks) { | 24 | block_to_index.emplace(block, index); |
| 24 | block_to_index.emplace(block, index); | 25 | ++index; |
| 25 | ++index; | ||
| 26 | } | ||
| 27 | } | 26 | } |
| 28 | std::string ret; | 27 | std::string ret; |
| 29 | for (const IR::Function& function : program.functions) { | 28 | for (const auto& block : program.blocks) { |
| 30 | ret += fmt::format("Function\n"); | 29 | ret += IR::DumpBlock(*block, block_to_index, inst_to_index, index) + '\n'; |
| 31 | for (const auto& block : function.blocks) { | ||
| 32 | ret += IR::DumpBlock(*block, block_to_index, inst_to_index, index) + '\n'; | ||
| 33 | } | ||
| 34 | } | 30 | } |
| 35 | return ret; | 31 | return ret; |
| 36 | } | 32 | } |