Skip to content
Snippets Groups Projects
Commit 17a0ef1e authored by Subv's avatar Subv
Browse files

ShaderGen: Implemented the KIL instruction, which is equivalent to 'discard'.

parent c3a8ea76
No related branches found
No related tags found
No related merge requests found
...@@ -566,10 +566,16 @@ private: ...@@ -566,10 +566,16 @@ private:
default: { default: {
switch (instr.opcode.EffectiveOpCode()) { switch (instr.opcode.EffectiveOpCode()) {
case OpCode::Id::EXIT: { case OpCode::Id::EXIT: {
ASSERT_MSG(instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex),
"Predicated exits not implemented");
shader.AddLine("return true;"); shader.AddLine("return true;");
offset = PROGRAM_END - 1; offset = PROGRAM_END - 1;
break; break;
} }
case OpCode::Id::KIL: {
shader.AddLine("discard;");
break;
}
case OpCode::Id::IPA: { case OpCode::Id::IPA: {
const auto& attribute = instr.attribute.fmt28; const auto& attribute = instr.attribute.fmt28;
std::string dest = GetRegister(instr.gpr0); std::string dest = GetRegister(instr.gpr0);
...@@ -589,7 +595,7 @@ private: ...@@ -589,7 +595,7 @@ private:
} }
// Close the predicate condition scope. // Close the predicate condition scope.
if (instr.pred != Pred::UnusedIndex) { if (instr.pred.pred_index != static_cast<u64>(Pred::UnusedIndex)) {
--shader.scope; --shader.scope;
shader.AddLine('}'); shader.AddLine('}');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment