Merge pull request #241 from Subv/gpu_method_call

GPU: Process command mode 5 (IncreaseOnce) differently from other commands
This commit is contained in:
bunnei
2018-03-16 22:28:22 -04:00
committed by GitHub
9 changed files with 97 additions and 8 deletions

View File

@ -8,8 +8,23 @@
namespace Tegra {
namespace Engines {
const std::unordered_map<u32, Maxwell3D::MethodInfo> Maxwell3D::method_handlers = {
{0xE24, {"PrepareShader", 5, &Maxwell3D::PrepareShader}},
};
Maxwell3D::Maxwell3D(MemoryManager& memory_manager) : memory_manager(memory_manager) {}
void Maxwell3D::CallMethod(u32 method, const std::vector<u32>& parameters) {
auto itr = method_handlers.find(method);
if (itr == method_handlers.end()) {
LOG_ERROR(HW_GPU, "Unhandled method call %08X", method);
return;
}
ASSERT(itr->second.arguments == parameters.size());
(this->*itr->second.handler)(parameters);
}
void Maxwell3D::WriteReg(u32 method, u32 value) {
ASSERT_MSG(method < Regs::NUM_REGS,
"Invalid Maxwell3D register, increase the size of the Regs structure");
@ -64,5 +79,7 @@ void Maxwell3D::DrawArrays() {
LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring");
}
void Maxwell3D::PrepareShader(const std::vector<u32>& parameters) {}
} // namespace Engines
} // namespace Tegra