diff options
author | Subv <subv2112@gmail.com> | 2018-08-11 23:00:14 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-08-11 23:00:14 +0200 |
commit | c1ad9738810d312ec38beccd709ce0853641a94a (patch) | |
tree | 999f11d3e815983d173e7db2d408f03762f39f51 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | GPU/Shaders: Implemented SSY and SYNC as a way to modify control flow during shader execution. (diff) | |
download | yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar.gz yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar.bz2 yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar.lz yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar.xz yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.tar.zst yuzu-c1ad9738810d312ec38beccd709ce0853641a94a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 532a47037..8954deb81 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -837,7 +837,11 @@ private: ASSERT_MSG(instr.pred.full_pred != Pred::NeverExecute, "NeverExecute predicate not implemented"); - if (instr.pred.pred_index != static_cast<u64>(Pred::UnusedIndex)) { + // Some instructions (like SSY) don't have a predicate field, they are always + // unconditionally executed. + bool can_be_predicated = OpCode::IsPredicatedInstruction(opcode->GetId()); + + if (can_be_predicated && instr.pred.pred_index != static_cast<u64>(Pred::UnusedIndex)) { shader.AddLine("if (" + GetPredicateCondition(instr.pred.pred_index, instr.negate_pred != 0) + ')'); @@ -1709,7 +1713,7 @@ private: } // Close the predicate condition scope. - if (instr.pred.pred_index != static_cast<u64>(Pred::UnusedIndex)) { + if (can_be_predicated && instr.pred.pred_index != static_cast<u64>(Pred::UnusedIndex)) { --shader.scope; shader.AddLine('}'); } |