MTLShader.h 671 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2022 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <Metal/Metal.h>
  5. #include "VideoBackends/Metal/MRCHelpers.h"
  6. #include "VideoCommon/AbstractPipeline.h"
  7. #include "VideoCommon/AbstractShader.h"
  8. namespace Metal
  9. {
  10. class Shader : public AbstractShader
  11. {
  12. public:
  13. explicit Shader(ShaderStage stage, std::string msl, MRCOwned<id<MTLFunction>> shader);
  14. ~Shader();
  15. id<MTLFunction> GetShader() const { return m_shader; }
  16. const std::string& GetMSL() const { return m_msl; }
  17. BinaryData GetBinary() const override;
  18. private:
  19. std::string m_msl;
  20. MRCOwned<id<MTLFunction>> m_shader;
  21. };
  22. } // namespace Metal