VERY experimental Nintendo Switch 2 emulator
C++
shader_jit_x64: Get rid of unnecessary last_program_counter variable.
bunneiaec7a517ea37
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cppindex dda9bcef71..fae7e8b414 100644--- a/src/video_core/shader/shader_jit_x64.cpp+++ b/src/video_core/shader/shader_jit_x64.cpp@@ -677,7 +677,7 @@ void JitCompiler::Compile_MAD(Instruction instr) {}void JitCompiler::Compile_IF(Instruction instr) {- RuntimeAssert(instr.flow_control.dest_offset > last_program_counter, "Backwards if-statements not supported");+ RuntimeAssert(instr.flow_control.dest_offset >= program_counter, "Backwards if-statements not supported");// Evaluate the "IF" conditionif (instr.opcode.Value() == OpCode::Id::IFU) {@@ -708,7 +708,7 @@ void JitCompiler::Compile_IF(Instruction instr) {}void JitCompiler::Compile_LOOP(Instruction instr) {- RuntimeAssert(instr.flow_control.dest_offset > last_program_counter, "Backwards loops not supported");+ RuntimeAssert(instr.flow_control.dest_offset >= program_counter, "Backwards loops not supported");RuntimeAssert(!looping, "Nested loops not supported");looping = true;@@ -770,8 +770,6 @@ void JitCompiler::Compile_Return() {}void JitCompiler::Compile_NextInstr() {- last_program_counter = program_counter;-auto search = return_offsets.find(program_counter);if (search != return_offsets.end()) {Compile_Return();@@ -839,7 +837,6 @@ void JitCompiler::Compile() {FindReturnOffsets();// Reset flow control state- last_program_counter = 0;program_counter = 0;looping = false;code_ptr.fill(nullptr);diff --git a/src/video_core/shader/shader_jit_x64.h b/src/video_core/shader/shader_jit_x64.hindex 159b902b25..920a269e23 100644--- a/src/video_core/shader/shader_jit_x64.h+++ b/src/video_core/shader/shader_jit_x64.h@@ -108,7 +108,6 @@ private:/// Offsets in code where a return needs to be insertedstd::set<unsigned> return_offsets;- unsigned last_program_counter = 0; ///< Offset of the most recent instruction decodedunsigned program_counter = 0; ///< Offset of the next instruction to decodebool looping = false; ///< True if compiling a loop, used to check for nested loops