summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Metal/MTLShader.h
blob: dca9d9793191a75f6e9a7f97e1fb428c52ad41d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2022 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <Metal/Metal.h>

#include "VideoBackends/Metal/MRCHelpers.h"

#include "VideoCommon/AbstractPipeline.h"
#include "VideoCommon/AbstractShader.h"

namespace Metal
{
class Shader : public AbstractShader
{
public:
  explicit Shader(ShaderStage stage, std::string msl, MRCOwned<id<MTLFunction>> shader);
  ~Shader();

  id<MTLFunction> GetShader() const { return m_shader; }
  const std::string& GetMSL() const { return m_msl; }
  BinaryData GetBinary() const override;

private:
  std::string m_msl;
  MRCOwned<id<MTLFunction>> m_shader;
};
}  // namespace Metal