diff options
Diffstat (limited to 'src/video_core/macro')
| -rw-r--r-- | src/video_core/macro/macro_hle.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/macro/macro_hle.h | 2 | ||||
| -rw-r--r-- | src/video_core/macro/macro_interpreter.cpp | 20 | ||||
| -rw-r--r-- | src/video_core/macro/macro_interpreter.h | 10 | ||||
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 16 | ||||
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.h | 4 |
6 files changed, 29 insertions, 29 deletions
diff --git a/src/video_core/macro/macro_hle.cpp b/src/video_core/macro/macro_hle.cpp index df00b57df..70ac7c620 100644 --- a/src/video_core/macro/macro_hle.cpp +++ b/src/video_core/macro/macro_hle.cpp | |||
| @@ -85,7 +85,7 @@ constexpr std::array<std::pair<u64, HLEFunction>, 3> hle_funcs{{ | |||
| 85 | {0x0217920100488FF7, &HLE_0217920100488FF7}, | 85 | {0x0217920100488FF7, &HLE_0217920100488FF7}, |
| 86 | }}; | 86 | }}; |
| 87 | 87 | ||
| 88 | HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {} | 88 | HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d_) : maxwell3d{maxwell3d_} {} |
| 89 | HLEMacro::~HLEMacro() = default; | 89 | HLEMacro::~HLEMacro() = default; |
| 90 | 90 | ||
| 91 | std::optional<std::unique_ptr<CachedMacro>> HLEMacro::GetHLEProgram(u64 hash) const { | 91 | std::optional<std::unique_ptr<CachedMacro>> HLEMacro::GetHLEProgram(u64 hash) const { |
| @@ -99,8 +99,8 @@ std::optional<std::unique_ptr<CachedMacro>> HLEMacro::GetHLEProgram(u64 hash) co | |||
| 99 | 99 | ||
| 100 | HLEMacroImpl::~HLEMacroImpl() = default; | 100 | HLEMacroImpl::~HLEMacroImpl() = default; |
| 101 | 101 | ||
| 102 | HLEMacroImpl::HLEMacroImpl(Engines::Maxwell3D& maxwell3d, HLEFunction func) | 102 | HLEMacroImpl::HLEMacroImpl(Engines::Maxwell3D& maxwell3d_, HLEFunction func_) |
| 103 | : maxwell3d(maxwell3d), func(func) {} | 103 | : maxwell3d{maxwell3d_}, func{func_} {} |
| 104 | 104 | ||
| 105 | void HLEMacroImpl::Execute(const std::vector<u32>& parameters, u32 method) { | 105 | void HLEMacroImpl::Execute(const std::vector<u32>& parameters, u32 method) { |
| 106 | func(maxwell3d, parameters); | 106 | func(maxwell3d, parameters); |
diff --git a/src/video_core/macro/macro_hle.h b/src/video_core/macro/macro_hle.h index 37af875a0..cb3bd1600 100644 --- a/src/video_core/macro/macro_hle.h +++ b/src/video_core/macro/macro_hle.h | |||
| @@ -20,7 +20,7 @@ using HLEFunction = void (*)(Engines::Maxwell3D& maxwell3d, const std::vector<u3 | |||
| 20 | 20 | ||
| 21 | class HLEMacro { | 21 | class HLEMacro { |
| 22 | public: | 22 | public: |
| 23 | explicit HLEMacro(Engines::Maxwell3D& maxwell3d); | 23 | explicit HLEMacro(Engines::Maxwell3D& maxwell3d_); |
| 24 | ~HLEMacro(); | 24 | ~HLEMacro(); |
| 25 | 25 | ||
| 26 | std::optional<std::unique_ptr<CachedMacro>> GetHLEProgram(u64 hash) const; | 26 | std::optional<std::unique_ptr<CachedMacro>> GetHLEProgram(u64 hash) const; |
diff --git a/src/video_core/macro/macro_interpreter.cpp b/src/video_core/macro/macro_interpreter.cpp index bd01fd1f2..44a71aa6c 100644 --- a/src/video_core/macro/macro_interpreter.cpp +++ b/src/video_core/macro/macro_interpreter.cpp | |||
| @@ -11,29 +11,29 @@ | |||
| 11 | MICROPROFILE_DEFINE(MacroInterp, "GPU", "Execute macro interpreter", MP_RGB(128, 128, 192)); | 11 | MICROPROFILE_DEFINE(MacroInterp, "GPU", "Execute macro interpreter", MP_RGB(128, 128, 192)); |
| 12 | 12 | ||
| 13 | namespace Tegra { | 13 | namespace Tegra { |
| 14 | MacroInterpreter::MacroInterpreter(Engines::Maxwell3D& maxwell3d) | 14 | MacroInterpreter::MacroInterpreter(Engines::Maxwell3D& maxwell3d_) |
| 15 | : MacroEngine::MacroEngine(maxwell3d), maxwell3d(maxwell3d) {} | 15 | : MacroEngine{maxwell3d_}, maxwell3d{maxwell3d_} {} |
| 16 | 16 | ||
| 17 | std::unique_ptr<CachedMacro> MacroInterpreter::Compile(const std::vector<u32>& code) { | 17 | std::unique_ptr<CachedMacro> MacroInterpreter::Compile(const std::vector<u32>& code) { |
| 18 | return std::make_unique<MacroInterpreterImpl>(maxwell3d, code); | 18 | return std::make_unique<MacroInterpreterImpl>(maxwell3d, code); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | MacroInterpreterImpl::MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d, | 21 | MacroInterpreterImpl::MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d_, |
| 22 | const std::vector<u32>& code) | 22 | const std::vector<u32>& code_) |
| 23 | : maxwell3d(maxwell3d), code(code) {} | 23 | : maxwell3d{maxwell3d_}, code{code_} {} |
| 24 | 24 | ||
| 25 | void MacroInterpreterImpl::Execute(const std::vector<u32>& parameters, u32 method) { | 25 | void MacroInterpreterImpl::Execute(const std::vector<u32>& params, u32 method) { |
| 26 | MICROPROFILE_SCOPE(MacroInterp); | 26 | MICROPROFILE_SCOPE(MacroInterp); |
| 27 | Reset(); | 27 | Reset(); |
| 28 | 28 | ||
| 29 | registers[1] = parameters[0]; | 29 | registers[1] = params[0]; |
| 30 | num_parameters = parameters.size(); | 30 | num_parameters = params.size(); |
| 31 | 31 | ||
| 32 | if (num_parameters > parameters_capacity) { | 32 | if (num_parameters > parameters_capacity) { |
| 33 | parameters_capacity = num_parameters; | 33 | parameters_capacity = num_parameters; |
| 34 | this->parameters = std::make_unique<u32[]>(num_parameters); | 34 | parameters = std::make_unique<u32[]>(num_parameters); |
| 35 | } | 35 | } |
| 36 | std::memcpy(this->parameters.get(), parameters.data(), num_parameters * sizeof(u32)); | 36 | std::memcpy(parameters.get(), params.data(), num_parameters * sizeof(u32)); |
| 37 | 37 | ||
| 38 | // Execute the code until we hit an exit condition. | 38 | // Execute the code until we hit an exit condition. |
| 39 | bool keep_executing = true; | 39 | bool keep_executing = true; |
diff --git a/src/video_core/macro/macro_interpreter.h b/src/video_core/macro/macro_interpreter.h index 90217fc89..d50c619ce 100644 --- a/src/video_core/macro/macro_interpreter.h +++ b/src/video_core/macro/macro_interpreter.h | |||
| @@ -17,7 +17,7 @@ class Maxwell3D; | |||
| 17 | 17 | ||
| 18 | class MacroInterpreter final : public MacroEngine { | 18 | class MacroInterpreter final : public MacroEngine { |
| 19 | public: | 19 | public: |
| 20 | explicit MacroInterpreter(Engines::Maxwell3D& maxwell3d); | 20 | explicit MacroInterpreter(Engines::Maxwell3D& maxwell3d_); |
| 21 | 21 | ||
| 22 | protected: | 22 | protected: |
| 23 | std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) override; | 23 | std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) override; |
| @@ -28,8 +28,8 @@ private: | |||
| 28 | 28 | ||
| 29 | class MacroInterpreterImpl : public CachedMacro { | 29 | class MacroInterpreterImpl : public CachedMacro { |
| 30 | public: | 30 | public: |
| 31 | MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); | 31 | explicit MacroInterpreterImpl(Engines::Maxwell3D& maxwell3d_, const std::vector<u32>& code_); |
| 32 | void Execute(const std::vector<u32>& parameters, u32 method) override; | 32 | void Execute(const std::vector<u32>& params, u32 method) override; |
| 33 | 33 | ||
| 34 | private: | 34 | private: |
| 35 | /// Resets the execution engine state, zeroing registers, etc. | 35 | /// Resets the execution engine state, zeroing registers, etc. |
| @@ -38,9 +38,9 @@ private: | |||
| 38 | /** | 38 | /** |
| 39 | * Executes a single macro instruction located at the current program counter. Returns whether | 39 | * Executes a single macro instruction located at the current program counter. Returns whether |
| 40 | * the interpreter should keep running. | 40 | * the interpreter should keep running. |
| 41 | * @param offset Offset to start execution at. | 41 | * |
| 42 | * @param is_delay_slot Whether the current step is being executed due to a delay slot in a | 42 | * @param is_delay_slot Whether the current step is being executed due to a delay slot in a |
| 43 | * previous instruction. | 43 | * previous instruction. |
| 44 | */ | 44 | */ |
| 45 | bool Step(bool is_delay_slot); | 45 | bool Step(bool is_delay_slot); |
| 46 | 46 | ||
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index 954b87515..c82bb987f 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp | |||
| @@ -28,15 +28,15 @@ static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ | |||
| 28 | BRANCH_HOLDER, | 28 | BRANCH_HOLDER, |
| 29 | }); | 29 | }); |
| 30 | 30 | ||
| 31 | MacroJITx64::MacroJITx64(Engines::Maxwell3D& maxwell3d) | 31 | MacroJITx64::MacroJITx64(Engines::Maxwell3D& maxwell3d_) |
| 32 | : MacroEngine::MacroEngine(maxwell3d), maxwell3d(maxwell3d) {} | 32 | : MacroEngine{maxwell3d_}, maxwell3d{maxwell3d_} {} |
| 33 | 33 | ||
| 34 | std::unique_ptr<CachedMacro> MacroJITx64::Compile(const std::vector<u32>& code) { | 34 | std::unique_ptr<CachedMacro> MacroJITx64::Compile(const std::vector<u32>& code) { |
| 35 | return std::make_unique<MacroJITx64Impl>(maxwell3d, code); | 35 | return std::make_unique<MacroJITx64Impl>(maxwell3d, code); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | MacroJITx64Impl::MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code) | 38 | MacroJITx64Impl::MacroJITx64Impl(Engines::Maxwell3D& maxwell3d_, const std::vector<u32>& code_) |
| 39 | : Xbyak::CodeGenerator(MAX_CODE_SIZE), code(code), maxwell3d(maxwell3d) { | 39 | : CodeGenerator{MAX_CODE_SIZE}, code{code_}, maxwell3d{maxwell3d_} { |
| 40 | Compile(); | 40 | Compile(); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| @@ -553,15 +553,15 @@ Xbyak::Reg32 MacroJITx64Impl::Compile_GetRegister(u32 index, Xbyak::Reg32 dst) { | |||
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | void MacroJITx64Impl::Compile_ProcessResult(Macro::ResultOperation operation, u32 reg) { | 555 | void MacroJITx64Impl::Compile_ProcessResult(Macro::ResultOperation operation, u32 reg) { |
| 556 | const auto SetRegister = [this](u32 reg, const Xbyak::Reg32& result) { | 556 | const auto SetRegister = [this](u32 reg_index, const Xbyak::Reg32& result) { |
| 557 | // Register 0 is supposed to always return 0. NOP is implemented as a store to the zero | 557 | // Register 0 is supposed to always return 0. NOP is implemented as a store to the zero |
| 558 | // register. | 558 | // register. |
| 559 | if (reg == 0) { | 559 | if (reg_index == 0) { |
| 560 | return; | 560 | return; |
| 561 | } | 561 | } |
| 562 | mov(dword[STATE + offsetof(JITState, registers) + reg * sizeof(u32)], result); | 562 | mov(dword[STATE + offsetof(JITState, registers) + reg_index * sizeof(u32)], result); |
| 563 | }; | 563 | }; |
| 564 | const auto SetMethodAddress = [this](const Xbyak::Reg32& reg) { mov(METHOD_ADDRESS, reg); }; | 564 | const auto SetMethodAddress = [this](const Xbyak::Reg32& reg32) { mov(METHOD_ADDRESS, reg32); }; |
| 565 | 565 | ||
| 566 | switch (operation) { | 566 | switch (operation) { |
| 567 | case Macro::ResultOperation::IgnoreAndFetch: | 567 | case Macro::ResultOperation::IgnoreAndFetch: |
diff --git a/src/video_core/macro/macro_jit_x64.h b/src/video_core/macro/macro_jit_x64.h index a180e7428..7f50ac2f8 100644 --- a/src/video_core/macro/macro_jit_x64.h +++ b/src/video_core/macro/macro_jit_x64.h | |||
| @@ -23,7 +23,7 @@ constexpr size_t MAX_CODE_SIZE = 0x10000; | |||
| 23 | 23 | ||
| 24 | class MacroJITx64 final : public MacroEngine { | 24 | class MacroJITx64 final : public MacroEngine { |
| 25 | public: | 25 | public: |
| 26 | explicit MacroJITx64(Engines::Maxwell3D& maxwell3d); | 26 | explicit MacroJITx64(Engines::Maxwell3D& maxwell3d_); |
| 27 | 27 | ||
| 28 | protected: | 28 | protected: |
| 29 | std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) override; | 29 | std::unique_ptr<CachedMacro> Compile(const std::vector<u32>& code) override; |
| @@ -34,7 +34,7 @@ private: | |||
| 34 | 34 | ||
| 35 | class MacroJITx64Impl : public Xbyak::CodeGenerator, public CachedMacro { | 35 | class MacroJITx64Impl : public Xbyak::CodeGenerator, public CachedMacro { |
| 36 | public: | 36 | public: |
| 37 | MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); | 37 | explicit MacroJITx64Impl(Engines::Maxwell3D& maxwell3d_, const std::vector<u32>& code_); |
| 38 | ~MacroJITx64Impl(); | 38 | ~MacroJITx64Impl(); |
| 39 | 39 | ||
| 40 | void Execute(const std::vector<u32>& parameters, u32 method) override; | 40 | void Execute(const std::vector<u32>& parameters, u32 method) override; |