diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-04-19 01:03:38 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:29 +0200 |
commit | b541f5e5e333a8ec8c3569e02d67e59ad14217c2 (patch) | |
tree | 5b19bdd92d74ce8e32be75cfa2c27a4612a663de /src/shader_recompiler/frontend/maxwell | |
parent | shader: Implement delegation of Exit to dispatcher on CFG (diff) | |
download | yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar.gz yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar.bz2 yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar.lz yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar.xz yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.tar.zst yuzu-b541f5e5e333a8ec8c3569e02d67e59ad14217c2.zip |
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.cpp | 28 | ||||
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp index aee96eae3..59897cb3e 100644 --- a/src/shader_recompiler/frontend/maxwell/program.cpp +++ b/src/shader_recompiler/frontend/maxwell/program.cpp @@ -150,4 +150,32 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo return program; } +IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, + Environment& env2) { + IR::Program program{}; + Optimization::VertexATransformPass(vertex_a); + Optimization::VertexBTransformPass(vertex_b); + program.blocks.swap(vertex_a.blocks); + for (IR::Block* block : vertex_b.blocks) { + program.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); + + 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]; + } + 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; +} + } // namespace Shader::Maxwell diff --git a/src/shader_recompiler/frontend/maxwell/program.h b/src/shader_recompiler/frontend/maxwell/program.h index 542621a1d..6e5d5ddd0 100644 --- a/src/shader_recompiler/frontend/maxwell/program.h +++ b/src/shader_recompiler/frontend/maxwell/program.h @@ -21,4 +21,6 @@ namespace Shader::Maxwell { ObjectPool<IR::Block>& block_pool, Environment& env, Flow::CFG& cfg); +[[nodiscard]] IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, + Environment& env_vertex_b); } // namespace Shader::Maxwell |