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.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/video_core/engines/maxwell_3d.h') diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 93f7698a0..954369cf5 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -4,6 +4,8 @@ #pragma once +#include +#include #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" @@ -20,6 +22,13 @@ public: /// Write the value to the register identified by method. void WriteReg(u32 method, u32 value); + /** + * Handles a method call to this engine. + * @param method Method to call + * @param parameters Arguments to the method call + */ + void CallMethod(u32 method, const std::vector& parameters); + /// Register structure of the Maxwell3D engine. /// TODO(Subv): This structure will need to be made bigger as more registers are discovered. struct Regs { @@ -63,13 +72,24 @@ public: static_assert(sizeof(Regs) == Regs::NUM_REGS * sizeof(u32), "Maxwell3D Regs has wrong size"); private: + MemoryManager& memory_manager; + /// Handles a write to the QUERY_GET register. void ProcessQueryGet(); /// Handles a write to the VERTEX_END_GL register, triggering a draw. void DrawArrays(); - MemoryManager& memory_manager; + /// Method call handlers + void PrepareShader(const std::vector& parameters); + + struct MethodInfo { + const char* name; + u32 arguments; + void (Maxwell3D::*handler)(const std::vector& parameters); + }; + + static const std::unordered_map method_handlers; }; #define ASSERT_REG_POSITION(field_name, position) \ -- cgit v1.2.3