shader_ir: Implement BRX & BRA.CC

This commit is contained in:
Fernando Sahmkow 2019-06-24 21:25:38 -04:00 committed by FernandoS27
parent c218ae4b02
commit 8a6fc529a9
6 changed files with 76 additions and 4 deletions

View file

@ -949,6 +949,14 @@ private:
return {};
}
Id BranchIndirect(Operation operation) {
const Id op_a = VisitOperand<Type::Uint>(operation, 0);
Emit(OpStore(jmp_to, op_a));
BranchingOp([&]() { Emit(OpBranch(continue_label)); });
return {};
}
Id PushFlowStack(Operation operation) {
const auto target = std::get_if<ImmediateNode>(&*operation[0]);
ASSERT(target);
@ -1334,6 +1342,7 @@ private:
&SPIRVDecompiler::ImageStore,
&SPIRVDecompiler::Branch,
&SPIRVDecompiler::BranchIndirect,
&SPIRVDecompiler::PushFlowStack,
&SPIRVDecompiler::PopFlowStack,
&SPIRVDecompiler::Exit,