summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-12 06:25:44 +0200
committerGitHub <noreply@github.com>2018-08-12 06:25:44 +0200
commit3f81c38c6db050fda07208adb4e76538f08beb8c (patch)
treefb3ca7138265b62a374744a134ec569c566be532
parentMerge pull request #1022 from bunnei/fix-splat (diff)
parentgl_shader_decompiler: Fix GLSL compiler error with KIL instruction. (diff)
downloadyuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar.gz
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar.bz2
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar.lz
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar.xz
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.tar.zst
yuzu-3f81c38c6db050fda07208adb4e76538f08beb8c.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 85297bd00..d21daf28a 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1667,7 +1667,15 @@ private:
}
case OpCode::Id::KIL: {
ASSERT(instr.flow.cond == Tegra::Shader::FlowCondition::Always);
+
+ // Enclose "discard" in a conditional, so that GLSL compilation does not complain
+ // about unexecuted instructions that may follow this.
+ shader.AddLine("if (true) {");
+ ++shader.scope;
shader.AddLine("discard;");
+ --shader.scope;
+ shader.AddLine("}");
+
break;
}
case OpCode::Id::BRA: {