summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/control_flow.h
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-03-29 22:13:37 -0300
committerGravatar ameerj2021-07-22 21:51:25 -0400
commitb0d5572abfe1f14e02d8219f0a4d7dd09ff36fd1 (patch)
tree434c9473dafdf0a2b54e8f6d662141da71560005 /src/shader_recompiler/frontend/maxwell/control_flow.h
parentspirv: Fix default output attribute initialization (diff)
downloadyuzu-b0d5572abfe1f14e02d8219f0a4d7dd09ff36fd1.tar.gz
yuzu-b0d5572abfe1f14e02d8219f0a4d7dd09ff36fd1.tar.xz
yuzu-b0d5572abfe1f14e02d8219f0a4d7dd09ff36fd1.zip
shader: Fix indirect branches to scheduler instructions
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/control_flow.h')
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.h b/src/shader_recompiler/frontend/maxwell/control_flow.h
index 1e05fcb97..a8c90d27a 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.h
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.h
@@ -22,6 +22,8 @@
22 22
23namespace Shader::Maxwell::Flow { 23namespace Shader::Maxwell::Flow {
24 24
25struct Block;
26
25using FunctionId = size_t; 27using FunctionId = size_t;
26 28
27enum class EndClass { 29enum class EndClass {
@@ -60,6 +62,11 @@ private:
60 boost::container::small_vector<StackEntry, 3> entries; 62 boost::container::small_vector<StackEntry, 3> entries;
61}; 63};
62 64
65struct IndirectBranch {
66 Block* block;
67 u32 address;
68};
69
63struct Block : boost::intrusive::set_base_hook< 70struct Block : boost::intrusive::set_base_hook<
64 // Normal link is ~2.5% faster compared to safe link 71 // Normal link is ~2.5% faster compared to safe link
65 boost::intrusive::link_mode<boost::intrusive::normal_link>> { 72 boost::intrusive::link_mode<boost::intrusive::normal_link>> {
@@ -84,7 +91,7 @@ struct Block : boost::intrusive::set_base_hook<
84 Block* return_block; 91 Block* return_block;
85 s32 branch_offset; 92 s32 branch_offset;
86 }; 93 };
87 std::vector<Block*> indirect_branches; 94 std::vector<IndirectBranch> indirect_branches;
88}; 95};
89 96
90struct Label { 97struct Label {