Browse Source
Merge pull request #1027 from bunnei/fix-kil
gl_shader_decompiler: Fix GLSL compiler error with KIL instruction.
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
0 deletions
-
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: { |
|
|
|
|