2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

gl_shader_decompiler: Fix GLSL compiler error with KIL instruction.

This commit is contained in:
bunnei 2018-08-12 00:06:48 -04:00
parent a921d22545
commit c68aa65226

View file

@ -1667,7 +1667,15 @@ private:
} }
case OpCode::Id::KIL: { case OpCode::Id::KIL: {
ASSERT(instr.flow.cond == Tegra::Shader::FlowCondition::Always); 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.AddLine("discard;");
--shader.scope;
shader.AddLine("}");
break; break;
} }
case OpCode::Id::BRA: { case OpCode::Id::BRA: {