summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/program.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/program.cpp18
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
15namespace Shader::IR { 16namespace 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}