diff options
| author | 2021-02-08 02:54:35 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | 2930dccecc933d6748772e9f51a5724fe1e6771b (patch) | |
| tree | ec4aa48062f8a2fcba31b1c64f769ddf25a87832 /src/shader_recompiler/main.cpp | |
| parent | shader: Better constant folding (diff) | |
| download | yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.tar.gz yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.tar.xz yuzu-2930dccecc933d6748772e9f51a5724fe1e6771b.zip | |
spirv: Initial SPIR-V support
Diffstat (limited to 'src/shader_recompiler/main.cpp')
| -rw-r--r-- | src/shader_recompiler/main.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/shader_recompiler/main.cpp b/src/shader_recompiler/main.cpp index 19e36590c..9887e066d 100644 --- a/src/shader_recompiler/main.cpp +++ b/src/shader_recompiler/main.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <fmt/format.h> | 7 | #include <fmt/format.h> |
| 8 | 8 | ||
| 9 | #include "shader_recompiler/backend/spirv/emit_spirv.h" | ||
| 9 | #include "shader_recompiler/file_environment.h" | 10 | #include "shader_recompiler/file_environment.h" |
| 10 | #include "shader_recompiler/frontend/ir/basic_block.h" | 11 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 11 | #include "shader_recompiler/frontend/ir/ir_emitter.h" | 12 | #include "shader_recompiler/frontend/ir/ir_emitter.h" |
| @@ -51,18 +52,18 @@ void RunDatabase() { | |||
| 51 | int main() { | 52 | int main() { |
| 52 | // RunDatabase(); | 53 | // RunDatabase(); |
| 53 | 54 | ||
| 54 | // FileEnvironment env{"D:\\Shaders\\Database\\test.bin"}; | ||
| 55 | FileEnvironment env{"D:\\Shaders\\Database\\Oninaki\\CS15C2FB1F0B965767.bin"}; | ||
| 56 | auto cfg{std::make_unique<Flow::CFG>(env, 0)}; | ||
| 57 | // fmt::print(stdout, "{}\n", cfg->Dot()); | ||
| 58 | |||
| 59 | auto inst_pool{std::make_unique<ObjectPool<IR::Inst>>()}; | 55 | auto inst_pool{std::make_unique<ObjectPool<IR::Inst>>()}; |
| 60 | auto block_pool{std::make_unique<ObjectPool<IR::Block>>()}; | 56 | auto block_pool{std::make_unique<ObjectPool<IR::Block>>()}; |
| 61 | 57 | ||
| 62 | for (int i = 0; i < 8192 * 4; ++i) { | 58 | // FileEnvironment env{"D:\\Shaders\\Database\\test.bin"}; |
| 63 | void(inst_pool->Create(IR::Opcode::Void, 0)); | 59 | FileEnvironment env{"D:\\Shaders\\Database\\Oninaki\\CS15C2FB1F0B965767.bin"}; |
| 60 | for (int i = 0; i < 1; ++i) { | ||
| 61 | block_pool->ReleaseContents(); | ||
| 62 | inst_pool->ReleaseContents(); | ||
| 63 | auto cfg{std::make_unique<Flow::CFG>(env, 0)}; | ||
| 64 | // fmt::print(stdout, "{}\n", cfg->Dot()); | ||
| 65 | IR::Program program{TranslateProgram(*inst_pool, *block_pool, env, *cfg)}; | ||
| 66 | // fmt::print(stdout, "{}\n", IR::DumpProgram(program)); | ||
| 67 | Backend::SPIRV::EmitSPIRV spirv{program}; | ||
| 64 | } | 68 | } |
| 65 | |||
| 66 | IR::Program program{TranslateProgram(*inst_pool, *block_pool, env, *cfg)}; | ||
| 67 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); | ||
| 68 | } | 69 | } |