diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-05-01 14:56:25 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:29 +0200 |
commit | c49d56c931471f21d475a31272164fbfae5ea64a (patch) | |
tree | 71642406f4df7963ea78c55acf622bdf5b85a595 /src/shader_recompiler/frontend | |
parent | shader: Implement VertexA stage (diff) | |
download | yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar.gz yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar.bz2 yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar.lz yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar.xz yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.tar.zst yuzu-c49d56c931471f21d475a31272164fbfae5ea64a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/control_flow.cpp | 10 | ||||
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.cpp | 37 | ||||
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.h | 1 |
3 files changed, 24 insertions, 24 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp index 298faa03e..e7abea82f 100644 --- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp @@ -209,9 +209,9 @@ CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_addre } } if (exits_to_dispatcher) { - const auto it = functions[0].blocks.rbegin(); - dispatch_block->begin = it->end + 1; - dispatch_block->end = it->end + 1; + const auto last_block{functions[0].blocks.rbegin()}; + dispatch_block->begin = last_block->end + 1; + dispatch_block->end = last_block->end + 1; functions[0].blocks.insert(*dispatch_block); } } @@ -481,7 +481,7 @@ CFG::AnalysisState CFG::AnalyzeEXIT(Block* block, FunctionId function_id, Locati return AnalysisState::Continue; } if (exits_to_dispatcher && function_id != 0) { - throw NotImplementedException("Dispatch EXIT on external function."); + throw NotImplementedException("Dispatch EXIT on external function"); } if (pred != Predicate{true} || flow_test != IR::FlowTest::T) { if (block->stack.Peek(Token::PEXIT).has_value()) { @@ -490,9 +490,9 @@ CFG::AnalysisState CFG::AnalyzeEXIT(Block* block, FunctionId function_id, Locati const IR::Condition cond{flow_test, static_cast<IR::Pred>(pred.index), pred.negated}; if (exits_to_dispatcher) { block->end = pc; - block->branch_true = dispatch_block; block->end_class = EndClass::Branch; block->cond = cond; + block->branch_true = dispatch_block; block->branch_false = AddLabel(block, block->stack, pc + 1, function_id); return AnalysisState::Branch; } diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp index 59897cb3e..a4fa4319d 100644 --- a/src/shader_recompiler/frontend/maxwell/program.cpp +++ b/src/shader_recompiler/frontend/maxwell/program.cpp @@ -151,31 +151,30 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo } IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, - Environment& env2) { - IR::Program program{}; + Environment& env_vertex_b) { + IR::Program result{}; Optimization::VertexATransformPass(vertex_a); Optimization::VertexBTransformPass(vertex_b); - program.blocks.swap(vertex_a.blocks); + std::swap(result.blocks, vertex_a.blocks); for (IR::Block* block : vertex_b.blocks) { - program.blocks.push_back(block); + result.blocks.push_back(block); } - program.stage = Stage::VertexB; - program.info = vertex_a.info; - program.local_memory_size = std::max(vertex_a.local_memory_size, vertex_b.local_memory_size); + result.stage = Stage::VertexB; + result.info = vertex_a.info; + result.local_memory_size = std::max(vertex_a.local_memory_size, vertex_b.local_memory_size); - for (size_t index = 0; index < 32; index++) { - program.info.input_generics[index].used |= vertex_b.info.input_generics[index].used; - program.info.stores_generics[index] |= vertex_b.info.stores_generics[index]; + for (size_t index = 0; index < 32; ++index) { + result.info.input_generics[index].used |= vertex_b.info.input_generics[index].used; + result.info.stores_generics[index] |= vertex_b.info.stores_generics[index]; } - Optimization::JoinTextureInfo(program.info, vertex_b.info); - Optimization::JoinStorageInfo(program.info, vertex_b.info); - Optimization::DualVertexJoinPass(program); - program.post_order_blocks = PostOrder(program.blocks); - Optimization::DeadCodeEliminationPass(program); - Optimization::IdentityRemovalPass(program); - Optimization::VerificationPass(program); - Optimization::CollectShaderInfoPass(env2, program); - return program; + Optimization::JoinTextureInfo(result.info, vertex_b.info); + Optimization::JoinStorageInfo(result.info, vertex_b.info); + Optimization::DualVertexJoinPass(result); + result.post_order_blocks = PostOrder(result.blocks); + Optimization::DeadCodeEliminationPass(result); + Optimization::VerificationPass(result); + Optimization::CollectShaderInfoPass(env_vertex_b, result); + return result; } } // namespace Shader::Maxwell diff --git a/src/shader_recompiler/frontend/maxwell/program.h b/src/shader_recompiler/frontend/maxwell/program.h index 6e5d5ddd0..f7f5930e4 100644 --- a/src/shader_recompiler/frontend/maxwell/program.h +++ b/src/shader_recompiler/frontend/maxwell/program.h @@ -23,4 +23,5 @@ namespace Shader::Maxwell { [[nodiscard]] IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, Environment& env_vertex_b); + } // namespace Shader::Maxwell |