GPU: Implemented a gpu macro interpreter.

The Ryujinx macro interpreter and envydis were used as reference.

Macros are programs that are uploaded by the games during boot and can later be called by writing to their method id in a GPU command buffer.
This commit is contained in:
Subv 2018-03-28 15:14:47 -05:00
parent be4c7ed082
commit 1ec8d2123d
5 changed files with 431 additions and 0 deletions

View file

@ -386,5 +386,10 @@ std::vector<Texture::FullTextureInfo> Maxwell3D::GetStageTextures(Regs::ShaderSt
return textures;
}
u32 Maxwell3D::GetRegisterValue(u32 method) const {
ASSERT_MSG(method < Regs::NUM_REGS, "Invalid Maxwell3D register");
return regs.reg_array[method];
}
} // namespace Engines
} // namespace Tegra

View file

@ -514,6 +514,9 @@ public:
State state{};
/// Reads a register value located at the input method address
u32 GetRegisterValue(u32 method) const;
/// Write the value to the register identified by method.
void WriteReg(u32 method, u32 value, u32 remaining_params);