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