diff options
| author | 2021-02-15 00:09:11 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | d5d468cf2cbe235ee149dbd37951389d2a7e61da (patch) | |
| tree | e99fe0e09c130d6171add858f6e9520d6b3948d5 /src/shader_recompiler/main.cpp | |
| parent | shader: Fix tracking (diff) | |
| download | yuzu-d5d468cf2cbe235ee149dbd37951389d2a7e61da.tar.gz yuzu-d5d468cf2cbe235ee149dbd37951389d2a7e61da.tar.xz yuzu-d5d468cf2cbe235ee149dbd37951389d2a7e61da.zip | |
shader: Improve object pool
Diffstat (limited to 'src/shader_recompiler/main.cpp')
| -rw-r--r-- | src/shader_recompiler/main.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/shader_recompiler/main.cpp b/src/shader_recompiler/main.cpp index 3b110af61..216345e91 100644 --- a/src/shader_recompiler/main.cpp +++ b/src/shader_recompiler/main.cpp | |||
| @@ -37,7 +37,7 @@ void RunDatabase() { | |||
| 37 | ForEachFile("D:\\Shaders\\Database", [&](const std::filesystem::path& path) { | 37 | ForEachFile("D:\\Shaders\\Database", [&](const std::filesystem::path& path) { |
| 38 | map.emplace_back(std::make_unique<FileEnvironment>(path.string().c_str())); | 38 | map.emplace_back(std::make_unique<FileEnvironment>(path.string().c_str())); |
| 39 | }); | 39 | }); |
| 40 | auto block_pool{std::make_unique<ObjectPool<Flow::Block>>()}; | 40 | ObjectPool<Flow::Block> block_pool; |
| 41 | using namespace std::chrono; | 41 | using namespace std::chrono; |
| 42 | auto t0 = high_resolution_clock::now(); | 42 | auto t0 = high_resolution_clock::now(); |
| 43 | int N = 1; | 43 | int N = 1; |
| @@ -48,8 +48,8 @@ void RunDatabase() { | |||
| 48 | // fmt::print(stdout, "Decoding {}\n", path.string()); | 48 | // fmt::print(stdout, "Decoding {}\n", path.string()); |
| 49 | 49 | ||
| 50 | const Location start_address{0}; | 50 | const Location start_address{0}; |
| 51 | block_pool->ReleaseContents(); | 51 | block_pool.ReleaseContents(); |
| 52 | Flow::CFG cfg{*env, *block_pool, start_address}; | 52 | Flow::CFG cfg{*env, block_pool, start_address}; |
| 53 | // fmt::print(stdout, "{}\n", cfg->Dot()); | 53 | // fmt::print(stdout, "{}\n", cfg->Dot()); |
| 54 | // IR::Program program{env, cfg}; | 54 | // IR::Program program{env, cfg}; |
| 55 | // Optimize(program); | 55 | // Optimize(program); |
| @@ -63,18 +63,18 @@ void RunDatabase() { | |||
| 63 | int main() { | 63 | int main() { |
| 64 | // RunDatabase(); | 64 | // RunDatabase(); |
| 65 | 65 | ||
| 66 | auto flow_block_pool{std::make_unique<ObjectPool<Flow::Block>>()}; | 66 | ObjectPool<Flow::Block> flow_block_pool; |
| 67 | auto inst_pool{std::make_unique<ObjectPool<IR::Inst>>()}; | 67 | ObjectPool<IR::Inst> inst_pool; |
| 68 | auto block_pool{std::make_unique<ObjectPool<IR::Block>>()}; | 68 | ObjectPool<IR::Block> block_pool; |
| 69 | 69 | ||
| 70 | // FileEnvironment env{"D:\\Shaders\\Database\\Oninaki\\CS8F146B41DB6BD826.bin"}; | 70 | // FileEnvironment env{"D:\\Shaders\\Database\\Oninaki\\CS8F146B41DB6BD826.bin"}; |
| 71 | FileEnvironment env{"D:\\Shaders\\shader.bin"}; | 71 | FileEnvironment env{"D:\\Shaders\\shader.bin"}; |
| 72 | block_pool->ReleaseContents(); | 72 | block_pool.ReleaseContents(); |
| 73 | inst_pool->ReleaseContents(); | 73 | inst_pool.ReleaseContents(); |
| 74 | flow_block_pool->ReleaseContents(); | 74 | flow_block_pool.ReleaseContents(); |
| 75 | Flow::CFG cfg{env, *flow_block_pool, 0}; | 75 | Flow::CFG cfg{env, flow_block_pool, 0}; |
| 76 | fmt::print(stdout, "{}\n", cfg.Dot()); | 76 | fmt::print(stdout, "{}\n", cfg.Dot()); |
| 77 | IR::Program program{TranslateProgram(*inst_pool, *block_pool, env, cfg)}; | 77 | IR::Program program{TranslateProgram(inst_pool, block_pool, env, cfg)}; |
| 78 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); | 78 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); |
| 79 | Backend::SPIRV::EmitSPIRV spirv{program}; | 79 | Backend::SPIRV::EmitSPIRV spirv{program}; |
| 80 | } | 80 | } |