Shader_IR: Implement Injectable Custom Variables to the IR.

This commit is contained in:
Fernando Sahmkow
2020-01-07 14:53:46 -04:00
committed by FernandoS27
parent 2b02f29a2d
commit 3c34678627
5 changed files with 70 additions and 1 deletions

View File

@ -39,6 +39,10 @@ Node ShaderIR::GetRegister(Register reg) {
return MakeNode<GprNode>(reg);
}
Node ShaderIR::GetCustomVariable(u32 id) {
return MakeNode<CustomVarNode>(id);
}
Node ShaderIR::GetImmediate19(Instruction instr) {
return Immediate(instr.alu.GetImm20_19());
}
@ -453,4 +457,9 @@ std::size_t ShaderIR::DeclareAmend(Node new_amend) {
return id;
}
u32 ShaderIR::NewCustomVariable() {
const u32 id = num_custom_variables++;
return id;
}
} // namespace VideoCommon::Shader