From a3c81745b17e05b019d0ac99d3dc93b97ea80370 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 25 Jan 2022 13:15:45 -0500 Subject: video_core/macro_hle: Move impl class into cpp file Given it's intended to be an internal implementation class, we can move it into the cpp file to ensure that. This also lets us move some header dependencies into the cpp file as well. --- src/video_core/macro/macro_hle.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/video_core/macro/macro_hle.h') diff --git a/src/video_core/macro/macro_hle.h b/src/video_core/macro/macro_hle.h index cb3bd1600..c0a12e793 100644 --- a/src/video_core/macro/macro_hle.h +++ b/src/video_core/macro/macro_hle.h @@ -6,9 +6,7 @@ #include #include -#include #include "common/common_types.h" -#include "video_core/macro/macro.h" namespace Tegra { @@ -16,8 +14,6 @@ namespace Engines { class Maxwell3D; } -using HLEFunction = void (*)(Engines::Maxwell3D& maxwell3d, const std::vector& parameters); - class HLEMacro { public: explicit HLEMacro(Engines::Maxwell3D& maxwell3d_); @@ -29,16 +25,4 @@ private: Engines::Maxwell3D& maxwell3d; }; -class HLEMacroImpl : public CachedMacro { -public: - explicit HLEMacroImpl(Engines::Maxwell3D& maxwell3d, HLEFunction func); - ~HLEMacroImpl(); - - void Execute(const std::vector& parameters, u32 method) override; - -private: - Engines::Maxwell3D& maxwell3d; - HLEFunction func; -}; - } // namespace Tegra -- cgit v1.2.3 From cfd9f7d25b4c1aea49b4dc017990f12142b8302b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 25 Jan 2022 13:50:10 -0500 Subject: video_core/macro_hle: Return unique_ptr directly from GetHLEProgram() Same behavior, but less code and header dependencies. --- src/video_core/macro/macro_hle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/video_core/macro/macro_hle.h') diff --git a/src/video_core/macro/macro_hle.h b/src/video_core/macro/macro_hle.h index c0a12e793..b86ba84a1 100644 --- a/src/video_core/macro/macro_hle.h +++ b/src/video_core/macro/macro_hle.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include "common/common_types.h" namespace Tegra { @@ -19,7 +18,9 @@ public: explicit HLEMacro(Engines::Maxwell3D& maxwell3d_); ~HLEMacro(); - std::optional> GetHLEProgram(u64 hash) const; + // Allocates and returns a cached macro if the hash matches a known function. + // Returns nullptr otherwise. + [[nodiscard]] std::unique_ptr GetHLEProgram(u64 hash) const; private: Engines::Maxwell3D& maxwell3d; -- cgit v1.2.3