summaryrefslogtreecommitdiff
path: root/src/video_core/macro_interpreter.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-29 23:36:03 -0400
committerGravatar bunnei2018-10-31 23:29:21 -0400
commitde0ab806df4575df93068e128d911dabbf396d2c (patch)
treeae9ce164967cd5bcfa824a1b7f0330957c792824 /src/video_core/macro_interpreter.h
parentMerge pull request #1604 from FearlessTobi/port-4369 (diff)
downloadyuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.gz
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.tar.xz
yuzu-de0ab806df4575df93068e128d911dabbf396d2c.zip
maxwell_3d: Restructure macro upload to use a single macro code memory.
- Fixes an issue where macros could be skipped. - Fixes rendering of distant objects in Super Mario Odyssey.
Diffstat (limited to 'src/video_core/macro_interpreter.h')
-rw-r--r--src/video_core/macro_interpreter.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/macro_interpreter.h b/src/video_core/macro_interpreter.h
index 773684bde..62d1ce289 100644
--- a/src/video_core/macro_interpreter.h
+++ b/src/video_core/macro_interpreter.h
@@ -22,10 +22,10 @@ public:
22 22
23 /** 23 /**
24 * Executes the macro code with the specified input parameters. 24 * Executes the macro code with the specified input parameters.
25 * @param code The macro byte code to execute 25 * @param offset Offset to start execution at.
26 * @param parameters The parameters of the macro 26 * @param parameters The parameters of the macro.
27 */ 27 */
28 void Execute(const std::vector<u32>& code, std::vector<u32> parameters); 28 void Execute(u32 offset, std::vector<u32> parameters);
29 29
30private: 30private:
31 enum class Operation : u32 { 31 enum class Operation : u32 {
@@ -110,11 +110,11 @@ private:
110 /** 110 /**
111 * Executes a single macro instruction located at the current program counter. Returns whether 111 * Executes a single macro instruction located at the current program counter. Returns whether
112 * the interpreter should keep running. 112 * the interpreter should keep running.
113 * @param code The macro code to execute. 113 * @param offset Offset to start execution at.
114 * @param is_delay_slot Whether the current step is being executed due to a delay slot in a 114 * @param is_delay_slot Whether the current step is being executed due to a delay slot in a
115 * previous instruction. 115 * previous instruction.
116 */ 116 */
117 bool Step(const std::vector<u32>& code, bool is_delay_slot); 117 bool Step(u32 offset, bool is_delay_slot);
118 118
119 /// Calculates the result of an ALU operation. src_a OP src_b; 119 /// Calculates the result of an ALU operation. src_a OP src_b;
120 u32 GetALUResult(ALUOperation operation, u32 src_a, u32 src_b) const; 120 u32 GetALUResult(ALUOperation operation, u32 src_a, u32 src_b) const;
@@ -127,7 +127,7 @@ private:
127 bool EvaluateBranchCondition(BranchCondition cond, u32 value) const; 127 bool EvaluateBranchCondition(BranchCondition cond, u32 value) const;
128 128
129 /// Reads an opcode at the current program counter location. 129 /// Reads an opcode at the current program counter location.
130 Opcode GetOpcode(const std::vector<u32>& code) const; 130 Opcode GetOpcode(u32 offset) const;
131 131
132 /// Returns the specified register's value. Register 0 is hardcoded to always return 0. 132 /// Returns the specified register's value. Register 0 is hardcoded to always return 0.
133 u32 GetRegister(u32 register_id) const; 133 u32 GetRegister(u32 register_id) const;