shader_decode: Partially implement BRA
This commit is contained in:
parent
4f95dc950e
commit
8215ae942c
1 changed files with 12 additions and 0 deletions
|
@ -11,6 +11,7 @@ namespace VideoCommon::Shader {
|
||||||
|
|
||||||
using Tegra::Shader::Instruction;
|
using Tegra::Shader::Instruction;
|
||||||
using Tegra::Shader::OpCode;
|
using Tegra::Shader::OpCode;
|
||||||
|
using Tegra::Shader::ConditionCode;
|
||||||
|
|
||||||
u32 ShaderIR::DecodeOther(BasicBlock& bb, u32 pc) {
|
u32 ShaderIR::DecodeOther(BasicBlock& bb, u32 pc) {
|
||||||
const Instruction instr = {program_code[pc]};
|
const Instruction instr = {program_code[pc]};
|
||||||
|
@ -45,6 +46,17 @@ u32 ShaderIR::DecodeOther(BasicBlock& bb, u32 pc) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case OpCode::Id::BRA: {
|
||||||
|
UNIMPLEMENTED_IF_MSG(instr.bra.constant_buffer != 0,
|
||||||
|
"BRA with constant buffers are not implemented");
|
||||||
|
|
||||||
|
const Tegra::Shader::ConditionCode cc = instr.flow_condition_code;
|
||||||
|
UNIMPLEMENTED_IF(cc != Tegra::Shader::ConditionCode::T);
|
||||||
|
|
||||||
|
const u32 target = pc + instr.bra.GetBranchTarget();
|
||||||
|
bb.push_back(Operation(OperationCode::Bra, Immediate(target)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case OpCode::Id::IPA: {
|
case OpCode::Id::IPA: {
|
||||||
const auto& attribute = instr.attribute.fmt28;
|
const auto& attribute = instr.attribute.fmt28;
|
||||||
const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(),
|
const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(),
|
||||||
|
|
Loading…
Reference in a new issue