• 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 
7 // ProgramPipeline.cpp: Implements 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 #include "libANGLE/ProgramPipeline.h"
12 
13 #include "libANGLE/angletypes.h"
14 #include "libANGLE/renderer/GLImplFactory.h"
15 #include "libANGLE/renderer/ProgramPipelineImpl.h"
16 
17 namespace gl
18 {
19 
ProgramPipelineState()20 ProgramPipelineState::ProgramPipelineState() : mLabel() {}
21 
~ProgramPipelineState()22 ProgramPipelineState::~ProgramPipelineState() {}
23 
getLabel() const24 const std::string &ProgramPipelineState::getLabel() const
25 {
26     return mLabel;
27 }
28 
ProgramPipeline(rx::GLImplFactory * factory,GLuint handle)29 ProgramPipeline::ProgramPipeline(rx::GLImplFactory *factory, GLuint handle)
30     : RefCountObject(handle), mProgramPipeline(factory->createProgramPipeline(mState))
31 {
32     ASSERT(mProgramPipeline);
33 }
34 
~ProgramPipeline()35 ProgramPipeline::~ProgramPipeline()
36 {
37     mProgramPipeline.release();
38 }
39 
onDestroy(const Context * context)40 void ProgramPipeline::onDestroy(const Context *context) {}
41 
setLabel(const Context * context,const std::string & label)42 void ProgramPipeline::setLabel(const Context *context, const std::string &label)
43 {
44     mState.mLabel = label;
45 }
46 
getLabel() const47 const std::string &ProgramPipeline::getLabel() const
48 {
49     return mState.mLabel;
50 }
51 
getImplementation() const52 rx::ProgramPipelineImpl *ProgramPipeline::getImplementation() const
53 {
54     return mProgramPipeline.get();
55 }
56 
57 }  // namespace gl
58