1 // 2 // Copyright 2016 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 // ProgramVk.h: 7 // Defines the class interface for ProgramVk, implementing ProgramImpl. 8 // 9 10 #ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ 11 #define LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ 12 13 #include <array> 14 15 #include "common/utilities.h" 16 #include "libANGLE/renderer/ProgramImpl.h" 17 #include "libANGLE/renderer/vulkan/ContextVk.h" 18 #include "libANGLE/renderer/vulkan/ProgramExecutableVk.h" 19 #include "libANGLE/renderer/vulkan/TransformFeedbackVk.h" 20 #include "libANGLE/renderer/vulkan/vk_helpers.h" 21 #include "libANGLE/renderer/vulkan/vk_renderer.h" 22 23 namespace rx 24 { 25 class ProgramVk : public ProgramImpl 26 { 27 public: 28 ProgramVk(const gl::ProgramState &state); 29 ~ProgramVk() override; 30 void destroy(const gl::Context *context) override; 31 32 angle::Result load(const gl::Context *context, 33 gl::BinaryInputStream *stream, 34 std::shared_ptr<LinkTask> *loadTaskOut, 35 egl::CacheGetResult *resultOut) override; 36 void save(const gl::Context *context, gl::BinaryOutputStream *stream) override; 37 void setBinaryRetrievableHint(bool retrievable) override; 38 void setSeparable(bool separable) override; 39 40 angle::Result link(const gl::Context *context, std::shared_ptr<LinkTask> *linkTaskOut) override; 41 GLboolean validate(const gl::Caps &caps) override; 42 getExecutable()43 const ProgramExecutableVk *getExecutable() const 44 { 45 return vk::GetImpl(&mState.getExecutable()); 46 } getExecutable()47 ProgramExecutableVk *getExecutable() { return vk::GetImpl(&mState.getExecutable()); } 48 49 private: 50 angle::Result createGraphicsPipelineWithDefaultState(const gl::Context *context, 51 vk::PipelineCacheAccess *pipelineCache); 52 }; 53 54 } // namespace rx 55 56 #endif // LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ 57