From 29feece4b849bd40cc6dcef6c60f4bc58707557a Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 16 Mar 2018 20:32:44 -0500 Subject: GPU: Process command mode 5 (IncreaseOnce) differently from other commands. Accumulate all arguments before calling the desired method. Note: Maybe we should do the same for the NonIncreasing mode? --- src/video_core/engines/maxwell_3d.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/video_core/engines/maxwell_3d.cpp') diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 842c5a014..ef32180dd 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -8,8 +8,23 @@ namespace Tegra { namespace Engines { +const std::unordered_map 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& 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"); @@ -56,5 +71,7 @@ void Maxwell3D::DrawArrays() { LOG_WARNING(HW_GPU, "Game requested a DrawArrays, ignoring"); } +void Maxwell3D::PrepareShader(const std::vector& parameters) {} + } // namespace Engines } // namespace Tegra -- cgit v1.2.3