• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2017 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 // ProgramPipelineVk.h:
7 //    Defines the class interface for ProgramPipelineVk, implementing ProgramPipelineImpl.
8 //
9 
10 #ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_
11 #define LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_
12 
13 #include "libANGLE/renderer/ProgramPipelineImpl.h"
14 
15 #include "libANGLE/renderer/vulkan/ContextVk.h"
16 #include "libANGLE/renderer/vulkan/ProgramExecutableVk.h"
17 #include "libANGLE/renderer/vulkan/ProgramVk.h"
18 
19 namespace rx
20 {
21 
22 class ProgramPipelineVk : public ProgramPipelineImpl
23 {
24   public:
25     ProgramPipelineVk(const gl::ProgramPipelineState &state);
26     ~ProgramPipelineVk() override;
27 
28     void destroy(const gl::Context *context) override;
29     void reset(ContextVk *contextVk);
30 
getExecutable()31     const ProgramExecutableVk &getExecutable() const { return mExecutable; }
getExecutable()32     ProgramExecutableVk &getExecutable() { return mExecutable; }
33 
getShaderProgram(const gl::State & glState,gl::ShaderType shaderType)34     ProgramVk *getShaderProgram(const gl::State &glState, gl::ShaderType shaderType) const
35     {
36         gl::ProgramPipeline *pipeline = glState.getProgramPipeline();
37         const gl::Program *program    = pipeline->getShaderProgram(shaderType);
38         if (program)
39         {
40             return vk::GetImpl(program);
41         }
42         return nullptr;
43     }
44 
45     void fillProgramStateMap(const ContextVk *contextVk,
46                              gl::ShaderMap<const gl::ProgramState *> *programStatesOut);
47 
48     angle::Result link(const gl::Context *context) override;
49 
50     angle::Result transformShaderSpirV(const gl::Context *glContext);
51 
52     angle::Result updateUniforms(ContextVk *contextVk);
53 
54     bool dirtyUniforms(const gl::State &glState);
55 
56   private:
57     ProgramExecutableVk mExecutable;
58 };
59 
60 }  // namespace rx
61 
62 #endif  // LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_
63