diff options
| author | 2019-06-28 22:59:43 -0400 | |
|---|---|---|
| committer | 2019-10-04 18:52:49 -0400 | |
| commit | 6fdd501113d5094f9148046c3b17cf2239e99aa5 (patch) | |
| tree | 5a328292210ac4f07696bad5ea237277a7cb9113 /src/video_core/shader/decode.cpp | |
| parent | shader_ir: Corrections to outward movements and misc stuffs (diff) | |
| download | yuzu-6fdd501113d5094f9148046c3b17cf2239e99aa5.tar.gz yuzu-6fdd501113d5094f9148046c3b17cf2239e99aa5.tar.xz yuzu-6fdd501113d5094f9148046c3b17cf2239e99aa5.zip | |
shader_ir: Declare Manager and pass it to appropiate programs.
Diffstat (limited to 'src/video_core/shader/decode.cpp')
| -rw-r--r-- | src/video_core/shader/decode.cpp | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp index 47a9fd961..381e87415 100644 --- a/src/video_core/shader/decode.cpp +++ b/src/video_core/shader/decode.cpp | |||
| @@ -39,36 +39,14 @@ void ShaderIR::Decode() { | |||
| 39 | std::memcpy(&header, program_code.data(), sizeof(Tegra::Shader::Header)); | 39 | std::memcpy(&header, program_code.data(), sizeof(Tegra::Shader::Header)); |
| 40 | 40 | ||
| 41 | disable_flow_stack = false; | 41 | disable_flow_stack = false; |
| 42 | const auto info = ScanFlow(program_code, program_size, main_offset); | 42 | const auto info = |
| 43 | ScanFlow(program_code, program_size, main_offset, program_manager); | ||
| 43 | if (info) { | 44 | if (info) { |
| 44 | const auto& shader_info = *info; | 45 | const auto& shader_info = *info; |
| 45 | coverage_begin = shader_info.start; | 46 | coverage_begin = shader_info.start; |
| 46 | coverage_end = shader_info.end; | 47 | coverage_end = shader_info.end; |
| 47 | if (shader_info.decompilable) { | 48 | if (shader_info.decompiled) { |
| 48 | disable_flow_stack = true; | 49 | disable_flow_stack = true; |
| 49 | const auto insert_block = [this](NodeBlock& nodes, u32 label) { | ||
| 50 | if (label == static_cast<u32>(exit_branch)) { | ||
| 51 | return; | ||
| 52 | } | ||
| 53 | basic_blocks.insert({label, nodes}); | ||
| 54 | }; | ||
| 55 | const auto& blocks = shader_info.blocks; | ||
| 56 | NodeBlock current_block; | ||
| 57 | u32 current_label = static_cast<u32>(exit_branch); | ||
| 58 | for (auto& block : blocks) { | ||
| 59 | if (shader_info.labels.count(block.start) != 0) { | ||
| 60 | insert_block(current_block, current_label); | ||
| 61 | current_block.clear(); | ||
| 62 | current_label = block.start; | ||
| 63 | } | ||
| 64 | if (!block.ignore_branch) { | ||
| 65 | DecodeRangeInner(current_block, block.start, block.end); | ||
| 66 | InsertControlFlow(current_block, block); | ||
| 67 | } else { | ||
| 68 | DecodeRangeInner(current_block, block.start, block.end + 1); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | insert_block(current_block, current_label); | ||
| 72 | return; | 50 | return; |
| 73 | } | 51 | } |
| 74 | LOG_WARNING(HW_GPU, "Flow Stack Removing Failed! Falling back to old method"); | 52 | LOG_WARNING(HW_GPU, "Flow Stack Removing Failed! Falling back to old method"); |