From 17a0ef1e1eb65ceb41232e694f779e1645e2b2d7 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 20 Apr 2018 09:17:39 -0500 Subject: ShaderGen: Implemented the KIL instruction, which is equivalent to 'discard'. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 7aaee9464..2395945c3 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -566,10 +566,16 @@ private: default: { switch (instr.opcode.EffectiveOpCode()) { case OpCode::Id::EXIT: { + ASSERT_MSG(instr.pred.pred_index == static_cast(Pred::UnusedIndex), + "Predicated exits not implemented"); shader.AddLine("return true;"); offset = PROGRAM_END - 1; break; } + case OpCode::Id::KIL: { + shader.AddLine("discard;"); + break; + } case OpCode::Id::IPA: { const auto& attribute = instr.attribute.fmt28; std::string dest = GetRegister(instr.gpr0); @@ -589,7 +595,7 @@ private: } // Close the predicate condition scope. - if (instr.pred != Pred::UnusedIndex) { + if (instr.pred.pred_index != static_cast(Pred::UnusedIndex)) { --shader.scope; shader.AddLine('}'); } -- cgit v1.2.3