Welcome to mirror list, hosted at ThFree Co, Russian Federation.

metal_program_pool.hpp « shaders - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c8ed6130dea6c9f5fe2301bc08e98567c2f8cd8 (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
#pragma once
#import <MetalKit/MetalKit.h>

#include "shaders/program_pool.hpp"

#include "drape/pointers.hpp"

#include <map>
#include <string>

namespace gpu
{
namespace metal
{
class MetalProgramPool : public ProgramPool
{
public:
  explicit MetalProgramPool(id<MTLDevice> device);
  ~MetalProgramPool() override;

  drape_ptr<dp::GpuProgram> Get(Program program) override;

private:
  id<MTLFunction> GetFunction(std::string const & name);
  id<MTLLibrary> m_library;
  std::map<std::string, id<MTLFunction>> m_functions;
};
}  // namespace metal
}  // namespace gpu