macro_hle.h 966 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <optional>
  7. #include <vector>
  8. #include "common/common_types.h"
  9. #include "video_core/macro/macro.h"
  10. namespace Tegra {
  11. namespace Engines {
  12. class Maxwell3D;
  13. }
  14. using HLEFunction = void (*)(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters);
  15. class HLEMacro {
  16. public:
  17. explicit HLEMacro(Engines::Maxwell3D& maxwell3d);
  18. ~HLEMacro();
  19. std::optional<std::unique_ptr<CachedMacro>> GetHLEProgram(u64 hash) const;
  20. private:
  21. Engines::Maxwell3D& maxwell3d;
  22. };
  23. class HLEMacroImpl : public CachedMacro {
  24. public:
  25. explicit HLEMacroImpl(Engines::Maxwell3D& maxwell3d, HLEFunction func);
  26. ~HLEMacroImpl();
  27. void Execute(const std::vector<u32>& parameters, u32 method) override;
  28. private:
  29. Engines::Maxwell3D& maxwell3d;
  30. HLEFunction func;
  31. };
  32. } // namespace Tegra