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 7 // ProgramPipeline.h: Defines the gl::ProgramPipeline class. 8 // Implements GL program pipeline objects and related functionality. 9 // [OpenGL ES 3.1] section 7.4 page 105. 10 11 #ifndef LIBANGLE_PROGRAMPIPELINE_H_ 12 #define LIBANGLE_PROGRAMPIPELINE_H_ 13 14 #include <memory> 15 16 #include "common/angleutils.h" 17 #include "libANGLE/Debug.h" 18 #include "libANGLE/RefCountObject.h" 19 20 namespace rx 21 { 22 class GLImplFactory; 23 class ProgramPipelineImpl; 24 } // namespace rx 25 26 namespace gl 27 { 28 class Context; 29 class ProgramPipeline; 30 31 class ProgramPipelineState final : angle::NonCopyable 32 { 33 public: 34 ProgramPipelineState(); 35 ~ProgramPipelineState(); 36 37 const std::string &getLabel() const; 38 39 private: 40 friend class ProgramPipeline; 41 42 std::string mLabel; 43 }; 44 45 class ProgramPipeline final : public RefCountObject, public LabeledObject 46 { 47 public: 48 ProgramPipeline(rx::GLImplFactory *factory, GLuint handle); 49 ~ProgramPipeline() override; 50 51 void onDestroy(const Context *context) override; 52 53 void setLabel(const Context *context, const std::string &label) override; 54 const std::string &getLabel() const override; 55 56 rx::ProgramPipelineImpl *getImplementation() const; 57 58 private: 59 std::unique_ptr<rx::ProgramPipelineImpl> mProgramPipeline; 60 61 ProgramPipelineState mState; 62 }; 63 } // namespace gl 64 65 #endif // LIBANGLE_PROGRAMPIPELINE_H_ 66