summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-06-05 02:14:23 +0200
committerSubv <subv2112@gmail.com>2018-06-05 02:14:23 +0200
commitd27279092fd4d9b038e5b9132801eecea27a3248 (patch)
treef744368af17a42bc329465cc1aef288ea8577382 /src
parentMerge pull request #501 from Subv/shader_bra (diff)
downloadyuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar.gz
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar.bz2
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar.lz
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar.xz
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.tar.zst
yuzu-d27279092fd4d9b038e5b9132801eecea27a3248.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 4cfd6f042..c802532db 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -115,7 +115,16 @@ private:
if (const auto opcode = OpCode::Decode(instr)) {
switch (opcode->GetId()) {
case OpCode::Id::EXIT: {
- return exit_method = ExitMethod::AlwaysEnd;
+ // The EXIT instruction can be predicated, which means that the shader can
+ // conditionally end on this instruction. We have to consider the case where the
+ // condition is not met and check the exit method of that other basic block.
+ using Tegra::Shader::Pred;
+ if (instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex)) {
+ return exit_method = ExitMethod::AlwaysEnd;
+ } else {
+ ExitMethod not_met = Scan(offset + 1, end, labels);
+ return exit_method = ParallelExit(ExitMethod::AlwaysEnd, not_met);
+ }
}
case OpCode::Id::BRA: {
u32 target = offset + instr.bra.GetBranchTarget();