• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // ShaderMtl.h:
7 //    Defines the class interface for ShaderMtl, implementing ShaderImpl.
8 //
9 #ifndef LIBANGLE_RENDERER_METAL_SHADERMTL_H_
10 #define LIBANGLE_RENDERER_METAL_SHADERMTL_H_
11 
12 #include <map>
13 
14 #include "compiler/translator/TranslatorMetalDirect.h"
15 #include "libANGLE/renderer/ShaderImpl.h"
16 namespace rx
17 {
18 
19 class ShaderMtl : public ShaderImpl
20 {
21   public:
22     ShaderMtl(const gl::ShaderState &state);
23     ~ShaderMtl() override;
24 
25     std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
26                                                   gl::ShCompilerInstance *compilerInstance,
27                                                   ShCompileOptions options) override;
28 
getTranslatorMetalReflection()29     sh::TranslatorMetalReflection *getTranslatorMetalReflection()
30     {
31         return &translatorMetalReflection;
32     }
33 
34     std::string getDebugInfo() const override;
35 
36     sh::TranslatorMetalReflection translatorMetalReflection = {};
37 
38   private:
39     std::shared_ptr<WaitableCompileEvent> compileImplMtl(const gl::Context *context,
40                                                          gl::ShCompilerInstance *compilerInstance,
41                                                          const std::string &source,
42                                                          ShCompileOptions compileOptions);
43 };
44 
45 }  // namespace rx
46 
47 #endif /* LIBANGLE_RENDERER_METAL_SHADERMTL_H_ */
48