diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/program.cpp')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/program.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
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 | |||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, | 153 | IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, |
| 154 | Environment& env2) { | 154 | Environment& env_vertex_b) { |
| 155 | IR::Program program{}; | 155 | IR::Program result{}; |
| 156 | Optimization::VertexATransformPass(vertex_a); | 156 | Optimization::VertexATransformPass(vertex_a); |
| 157 | Optimization::VertexBTransformPass(vertex_b); | 157 | Optimization::VertexBTransformPass(vertex_b); |
| 158 | program.blocks.swap(vertex_a.blocks); | 158 | std::swap(result.blocks, vertex_a.blocks); |
| 159 | for (IR::Block* block : vertex_b.blocks) { | 159 | for (IR::Block* block : vertex_b.blocks) { |
| 160 | program.blocks.push_back(block); | 160 | result.blocks.push_back(block); |
| 161 | } | 161 | } |
| 162 | program.stage = Stage::VertexB; | 162 | result.stage = Stage::VertexB; |
| 163 | program.info = vertex_a.info; | 163 | result.info = vertex_a.info; |
| 164 | program.local_memory_size = std::max(vertex_a.local_memory_size, vertex_b.local_memory_size); | 164 | result.local_memory_size = std::max(vertex_a.local_memory_size, vertex_b.local_memory_size); |
| 165 | 165 | ||
| 166 | for (size_t index = 0; index < 32; index++) { | 166 | for (size_t index = 0; index < 32; ++index) { |
| 167 | program.info.input_generics[index].used |= vertex_b.info.input_generics[index].used; | 167 | result.info.input_generics[index].used |= vertex_b.info.input_generics[index].used; |
| 168 | program.info.stores_generics[index] |= vertex_b.info.stores_generics[index]; | 168 | result.info.stores_generics[index] |= vertex_b.info.stores_generics[index]; |
| 169 | } | 169 | } |
| 170 | Optimization::JoinTextureInfo(program.info, vertex_b.info); | 170 | Optimization::JoinTextureInfo(result.info, vertex_b.info); |
| 171 | Optimization::JoinStorageInfo(program.info, vertex_b.info); | 171 | Optimization::JoinStorageInfo(result.info, vertex_b.info); |
| 172 | Optimization::DualVertexJoinPass(program); | 172 | Optimization::DualVertexJoinPass(result); |
| 173 | program.post_order_blocks = PostOrder(program.blocks); | 173 | result.post_order_blocks = PostOrder(result.blocks); |
| 174 | Optimization::DeadCodeEliminationPass(program); | 174 | Optimization::DeadCodeEliminationPass(result); |
| 175 | Optimization::IdentityRemovalPass(program); | 175 | Optimization::VerificationPass(result); |
| 176 | Optimization::VerificationPass(program); | 176 | Optimization::CollectShaderInfoPass(env_vertex_b, result); |
| 177 | Optimization::CollectShaderInfoPass(env2, program); | 177 | return result; |
| 178 | return program; | ||
| 179 | } | 178 | } |
| 180 | 179 | ||
| 181 | } // namespace Shader::Maxwell | 180 | } // namespace Shader::Maxwell |