summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-05-01 14:56:25 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:29 +0200
commitc49d56c931471f21d475a31272164fbfae5ea64a (patch)
tree71642406f4df7963ea78c55acf622bdf5b85a595 /src/shader_recompiler/ir_opt/dual_vertex_pass.cpp
parentshader: Implement VertexA stage (diff)
downloadyuzu-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/ir_opt/dual_vertex_pass.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp b/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp
index f35c6478a..f2d7db0e6 100644
--- a/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp
+++ b/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp
@@ -4,8 +4,6 @@
#include <algorithm>
#include <ranges>
-#include <tuple>
-#include <type_traits>
#include "common/bit_cast.h"
#include "common/bit_util.h"
@@ -40,7 +38,7 @@ void VertexATransformPass(IR::Program& program) {
}
void VertexBTransformPass(IR::Program& program) {
- for (IR::Block* const block : program.post_order_blocks | std::views::reverse) {
+ for (IR::Block* const block : program.blocks) {
for (IR::Inst& inst : block->Instructions()) {
if (inst.GetOpcode() == IR::Opcode::Prologue) {
return inst.Invalidate();
@@ -51,24 +49,24 @@ void VertexBTransformPass(IR::Program& program) {
void DualVertexJoinPass(IR::Program& program) {
const auto& blocks = program.blocks;
- s64 s = static_cast<s64>(blocks.size()) - 1;
- if (s < 1) {
- throw NotImplementedException("Dual Vertex Join pass failed, expected atleast 2 blocks!");
+ const s64 sub_size = static_cast<s64>(blocks.size()) - 1;
+ if (sub_size < 1) {
+ throw LogicError("Dual Vertex Join pass failed, expected atleast 2 blocks");
}
- for (s64 index = 0; index < s; index++) {
- IR::Block* const current_block = blocks[index];
- IR::Block* const next_block = blocks[index + 1];
+ for (s64 index = 0; index < sub_size; ++index) {
+ IR::Block* const current_block{blocks[index]};
+ IR::Block* const next_block{blocks[index + 1]};
for (IR::Inst& inst : current_block->Instructions()) {
if (inst.GetOpcode() == IR::Opcode::Join) {
IR::IREmitter ir{*current_block, IR::Block::InstructionList::s_iterator_to(inst)};
ir.Branch(next_block);
inst.Invalidate();
- // only 1 join should exist
+ // Only 1 join should exist
return;
}
}
}
- throw NotImplementedException("Dual Vertex Join pass failed, no join present!");
+ throw LogicError("Dual Vertex Join pass failed, no join present");
}
} // namespace Shader::Optimization