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(gl::ShaderType shaderType)34 ProgramVk *getShaderProgram(gl::ShaderType shaderType) const 35 { 36 const gl::Program *program = mState.getShaderProgram(shaderType); 37 return SafeGetImplAs<ProgramVk>(program); 38 } 39 40 void fillProgramStateMap(gl::ShaderMap<const gl::ProgramState *> *programStatesOut); 41 42 angle::Result link(const gl::Context *glContext, 43 const gl::ProgramMergedVaryings &mergedVaryings, 44 const gl::ProgramVaryingPacking &varyingPacking) override; 45 46 angle::Result updateUniforms(ContextVk *contextVk); 47 48 void setAllDefaultUniformsDirty(); 49 bool hasDirtyUniforms() const; 50 void onProgramBind(); 51 52 private: 53 size_t calcUniformUpdateRequiredSpace(ContextVk *contextVk, 54 gl::ShaderMap<VkDeviceSize> *uniformOffsets) const; 55 56 ProgramExecutableVk mExecutable; 57 }; 58 59 } // namespace rx 60 61 #endif // LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_ 62