Yunchao He | a336b90 | 2017-08-02 16:05:21 +0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 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 | |
| 20 | ProgramPipelineState::ProgramPipelineState() : mLabel() |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | ProgramPipelineState::~ProgramPipelineState() |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | const std::string &ProgramPipelineState::getLabel() const |
| 29 | { |
| 30 | return mLabel; |
| 31 | } |
| 32 | |
| 33 | ProgramPipeline::ProgramPipeline(rx::GLImplFactory *factory, GLuint handle) |
| 34 | : RefCountObject(handle), |
| 35 | mProgramPipeline(factory->createProgramPipeline(mState)) |
| 36 | { |
| 37 | ASSERT(mProgramPipeline); |
| 38 | } |
| 39 | |
| 40 | ProgramPipeline::~ProgramPipeline() |
| 41 | { |
| 42 | mProgramPipeline.release(); |
| 43 | } |
| 44 | |
| 45 | void ProgramPipeline::setLabel(const std::string &label) |
| 46 | { |
| 47 | mState.mLabel = label; |
| 48 | } |
| 49 | |
| 50 | const std::string &ProgramPipeline::getLabel() const |
| 51 | { |
| 52 | return mState.mLabel; |
| 53 | } |
| 54 | |
| 55 | rx::ProgramPipelineImpl *ProgramPipeline::getImplementation() const |
| 56 | { |
| 57 | return mProgramPipeline.get(); |
| 58 | } |
| 59 | |
| 60 | } // namespace gl |