• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2015 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 
7 // ShaderGL.h: Defines the class interface for ShaderGL.
8 
9 #ifndef LIBANGLE_RENDERER_GL_SHADERGL_H_
10 #define LIBANGLE_RENDERER_GL_SHADERGL_H_
11 
12 #include "libANGLE/renderer/ShaderImpl.h"
13 
14 namespace rx
15 {
16 class RendererGL;
17 enum class MultiviewImplementationTypeGL;
18 
19 class ShaderGL : public ShaderImpl
20 {
21   public:
22     ShaderGL(const gl::ShaderState &state,
23              GLuint shaderID,
24              MultiviewImplementationTypeGL multiviewImplementationType,
25              const std::shared_ptr<RendererGL> &renderer);
26     ~ShaderGL() override;
27 
28     void destroy() override;
29 
30     std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
31                                                   gl::ShCompilerInstance *compilerInstance,
32                                                   ShCompileOptions options) override;
33 
34     std::string getDebugInfo() const override;
35 
36     GLuint getShaderID() const;
37 
38   private:
39     void compileAndCheckShader(const char *source);
40     void compileShader(const char *source);
41     void checkShader();
42     bool peekCompletion();
43     bool compileAndCheckShaderInWorker(const char *source);
44 
45     GLuint mShaderID;
46     MultiviewImplementationTypeGL mMultiviewImplementationType;
47     std::shared_ptr<RendererGL> mRenderer;
48     GLint mCompileStatus;
49     std::string mInfoLog;
50 };
51 
52 }  // namespace rx
53 
54 #endif  // LIBANGLE_RENDERER_GL_SHADERGL_H_
55