diff options
| author | 2021-05-16 17:06:13 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | f7a2340205b4fa2db32403f20d7b7afe32b15f33 (patch) | |
| tree | 22059632c5f3bf068e686997d833368f6c22f6ec /src/shader_recompiler/backend/spirv/emit_spirv.cpp | |
| parent | glasm: Implement rest of shared mem (diff) | |
| download | yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.tar.gz yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.tar.xz yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.zip | |
shader_recompiler: GCC fixes
Fixes members of unnamed union not being accessible, and one function
without a declaration.
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 881a5dc4c..9ed2af991 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -112,48 +112,48 @@ void Traverse(EmitContext& ctx, IR::Program& program) { | |||
| 112 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { | 112 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { |
| 113 | switch (node.type) { | 113 | switch (node.type) { |
| 114 | case IR::AbstractSyntaxNode::Type::Block: { | 114 | case IR::AbstractSyntaxNode::Type::Block: { |
| 115 | const Id label{node.block->Definition<Id>()}; | 115 | const Id label{node.data.block->Definition<Id>()}; |
| 116 | if (current_block) { | 116 | if (current_block) { |
| 117 | ctx.OpBranch(label); | 117 | ctx.OpBranch(label); |
| 118 | } | 118 | } |
| 119 | current_block = node.block; | 119 | current_block = node.data.block; |
| 120 | ctx.AddLabel(label); | 120 | ctx.AddLabel(label); |
| 121 | for (IR::Inst& inst : node.block->Instructions()) { | 121 | for (IR::Inst& inst : node.data.block->Instructions()) { |
| 122 | EmitInst(ctx, &inst); | 122 | EmitInst(ctx, &inst); |
| 123 | } | 123 | } |
| 124 | break; | 124 | break; |
| 125 | } | 125 | } |
| 126 | case IR::AbstractSyntaxNode::Type::If: { | 126 | case IR::AbstractSyntaxNode::Type::If: { |
| 127 | const Id if_label{node.if_node.body->Definition<Id>()}; | 127 | const Id if_label{node.data.if_node.body->Definition<Id>()}; |
| 128 | const Id endif_label{node.if_node.merge->Definition<Id>()}; | 128 | const Id endif_label{node.data.if_node.merge->Definition<Id>()}; |
| 129 | ctx.OpSelectionMerge(endif_label, spv::SelectionControlMask::MaskNone); | 129 | ctx.OpSelectionMerge(endif_label, spv::SelectionControlMask::MaskNone); |
| 130 | ctx.OpBranchConditional(ctx.Def(node.if_node.cond), if_label, endif_label); | 130 | ctx.OpBranchConditional(ctx.Def(node.data.if_node.cond), if_label, endif_label); |
| 131 | break; | 131 | break; |
| 132 | } | 132 | } |
| 133 | case IR::AbstractSyntaxNode::Type::Loop: { | 133 | case IR::AbstractSyntaxNode::Type::Loop: { |
| 134 | const Id body_label{node.loop.body->Definition<Id>()}; | 134 | const Id body_label{node.data.loop.body->Definition<Id>()}; |
| 135 | const Id continue_label{node.loop.continue_block->Definition<Id>()}; | 135 | const Id continue_label{node.data.loop.continue_block->Definition<Id>()}; |
| 136 | const Id endloop_label{node.loop.merge->Definition<Id>()}; | 136 | const Id endloop_label{node.data.loop.merge->Definition<Id>()}; |
| 137 | 137 | ||
| 138 | ctx.OpLoopMerge(endloop_label, continue_label, spv::LoopControlMask::MaskNone); | 138 | ctx.OpLoopMerge(endloop_label, continue_label, spv::LoopControlMask::MaskNone); |
| 139 | ctx.OpBranch(body_label); | 139 | ctx.OpBranch(body_label); |
| 140 | break; | 140 | break; |
| 141 | } | 141 | } |
| 142 | case IR::AbstractSyntaxNode::Type::Break: { | 142 | case IR::AbstractSyntaxNode::Type::Break: { |
| 143 | const Id break_label{node.break_node.merge->Definition<Id>()}; | 143 | const Id break_label{node.data.break_node.merge->Definition<Id>()}; |
| 144 | const Id skip_label{node.break_node.skip->Definition<Id>()}; | 144 | const Id skip_label{node.data.break_node.skip->Definition<Id>()}; |
| 145 | ctx.OpBranchConditional(ctx.Def(node.break_node.cond), break_label, skip_label); | 145 | ctx.OpBranchConditional(ctx.Def(node.data.break_node.cond), break_label, skip_label); |
| 146 | break; | 146 | break; |
| 147 | } | 147 | } |
| 148 | case IR::AbstractSyntaxNode::Type::EndIf: | 148 | case IR::AbstractSyntaxNode::Type::EndIf: |
| 149 | if (current_block) { | 149 | if (current_block) { |
| 150 | ctx.OpBranch(node.end_if.merge->Definition<Id>()); | 150 | ctx.OpBranch(node.data.end_if.merge->Definition<Id>()); |
| 151 | } | 151 | } |
| 152 | break; | 152 | break; |
| 153 | case IR::AbstractSyntaxNode::Type::Repeat: { | 153 | case IR::AbstractSyntaxNode::Type::Repeat: { |
| 154 | const Id loop_header_label{node.repeat.loop_header->Definition<Id>()}; | 154 | const Id loop_header_label{node.data.repeat.loop_header->Definition<Id>()}; |
| 155 | const Id merge_label{node.repeat.merge->Definition<Id>()}; | 155 | const Id merge_label{node.data.repeat.merge->Definition<Id>()}; |
| 156 | ctx.OpBranchConditional(ctx.Def(node.repeat.cond), loop_header_label, merge_label); | 156 | ctx.OpBranchConditional(ctx.Def(node.data.repeat.cond), loop_header_label, merge_label); |
| 157 | break; | 157 | break; |
| 158 | } | 158 | } |
| 159 | case IR::AbstractSyntaxNode::Type::Return: | 159 | case IR::AbstractSyntaxNode::Type::Return: |