blob: 90177626bd05e0186179ff3520ef7838ed63fec0 [file] [log] [blame]
Geoff Langf9a6f082015-01-22 13:32:49 -05001//
2// Copyright 2015 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// ProgramGL.cpp: Implements the class methods for ProgramGL.
8
9#include "libANGLE/renderer/gl/ProgramGL.h"
10
11#include "common/debug.h"
Geoff Lang5ed74cf2015-04-14 13:57:07 -040012#include "common/utilities.h"
Geoff Langb1f435e2015-02-20 10:01:01 -050013#include "libANGLE/renderer/gl/FunctionsGL.h"
14#include "libANGLE/renderer/gl/ShaderGL.h"
15#include "libANGLE/renderer/gl/StateManagerGL.h"
Geoff Langf9a6f082015-01-22 13:32:49 -050016
17namespace rx
18{
19
Geoff Langb1f435e2015-02-20 10:01:01 -050020ProgramGL::ProgramGL(const FunctionsGL *functions, StateManagerGL *stateManager)
21 : ProgramImpl(),
22 mFunctions(functions),
23 mStateManager(stateManager),
24 mProgramID(0)
25{
26 ASSERT(mFunctions);
27 ASSERT(mStateManager);
Geoff Lang0ca53782015-05-07 13:49:39 -040028
29 mProgramID = mFunctions->createProgram();
Geoff Langb1f435e2015-02-20 10:01:01 -050030}
Geoff Langf9a6f082015-01-22 13:32:49 -050031
32ProgramGL::~ProgramGL()
Geoff Langb1f435e2015-02-20 10:01:01 -050033{
Geoff Lang0ca53782015-05-07 13:49:39 -040034 mFunctions->deleteProgram(mProgramID);
35 mProgramID = 0;
Geoff Langb1f435e2015-02-20 10:01:01 -050036}
Geoff Langf9a6f082015-01-22 13:32:49 -050037
38bool ProgramGL::usesPointSize() const
39{
40 UNIMPLEMENTED();
41 return bool();
42}
43
44int ProgramGL::getShaderVersion() const
45{
46 UNIMPLEMENTED();
47 return int();
48}
49
50GLenum ProgramGL::getTransformFeedbackBufferMode() const
51{
52 UNIMPLEMENTED();
53 return GLenum();
54}
55
56GLenum ProgramGL::getBinaryFormat()
57{
58 UNIMPLEMENTED();
59 return GLenum();
60}
61
62LinkResult ProgramGL::load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream)
63{
64 UNIMPLEMENTED();
65 return LinkResult(false, gl::Error(GL_INVALID_OPERATION));
66}
67
68gl::Error ProgramGL::save(gl::BinaryOutputStream *stream)
69{
70 UNIMPLEMENTED();
71 return gl::Error(GL_INVALID_OPERATION);
72}
73
74LinkResult ProgramGL::link(const gl::Data &data, gl::InfoLog &infoLog,
75 gl::Shader *fragmentShader, gl::Shader *vertexShader,
76 const std::vector<std::string> &transformFeedbackVaryings,
77 GLenum transformFeedbackBufferMode,
78 int *registers, std::vector<gl::LinkedVarying> *linkedVaryings,
79 std::map<int, gl::VariableLocation> *outputVariables)
80{
Geoff Langb1f435e2015-02-20 10:01:01 -050081 // Reset the program state, delete the current program if one exists
82 reset();
83
84 ShaderGL *vertexShaderGL = GetImplAs<ShaderGL>(vertexShader);
85 ShaderGL *fragmentShaderGL = GetImplAs<ShaderGL>(fragmentShader);
86
Geoff Langb1f435e2015-02-20 10:01:01 -050087 // Attach the shaders
88 mFunctions->attachShader(mProgramID, vertexShaderGL->getShaderID());
89 mFunctions->attachShader(mProgramID, fragmentShaderGL->getShaderID());
90
Geoff Langb1f435e2015-02-20 10:01:01 -050091 // Link and verify
92 mFunctions->linkProgram(mProgramID);
93
Geoff Lang0ca53782015-05-07 13:49:39 -040094 // Detach the shaders
95 mFunctions->detachShader(mProgramID, vertexShaderGL->getShaderID());
96 mFunctions->detachShader(mProgramID, fragmentShaderGL->getShaderID());
97
98 // Verify the link
Geoff Langb1f435e2015-02-20 10:01:01 -050099 GLint linkStatus = GL_FALSE;
100 mFunctions->getProgramiv(mProgramID, GL_LINK_STATUS, &linkStatus);
101 ASSERT(linkStatus == GL_TRUE);
102 if (linkStatus == GL_FALSE)
103 {
104 // Linking failed, put the error into the info log
105 GLint infoLogLength = 0;
106 mFunctions->getProgramiv(mProgramID, GL_INFO_LOG_LENGTH, &infoLogLength);
107
108 std::vector<char> buf(infoLogLength);
109 mFunctions->getProgramInfoLog(mProgramID, infoLogLength, nullptr, &buf[0]);
110
111 mFunctions->deleteProgram(mProgramID);
112 mProgramID = 0;
113
Jamie Madillf6113162015-05-07 11:49:21 -0400114 infoLog << &buf[0];
Geoff Langb1f435e2015-02-20 10:01:01 -0500115 TRACE("\n%s", &buf[0]);
116
117 // TODO, return GL_OUT_OF_MEMORY or just fail the link? This is an unexpected case
118 return LinkResult(false, gl::Error(GL_NO_ERROR));
119 }
120
121 // Query the uniform information
122 // TODO: A lot of this logic should be done at the gl::Program level
123 GLint activeUniformMaxLength = 0;
124 mFunctions->getProgramiv(mProgramID, GL_ACTIVE_UNIFORM_MAX_LENGTH, &activeUniformMaxLength);
125
126 std::vector<GLchar> uniformNameBuffer(activeUniformMaxLength);
127
128 GLint uniformCount = 0;
129 mFunctions->getProgramiv(mProgramID, GL_ACTIVE_UNIFORMS, &uniformCount);
130 for (GLint i = 0; i < uniformCount; i++)
131 {
132 GLsizei uniformNameLength = 0;
133 GLint uniformSize = 0;
134 GLenum uniformType = GL_NONE;
135 mFunctions->getActiveUniform(mProgramID, i, uniformNameBuffer.size(), &uniformNameLength, &uniformSize, &uniformType, &uniformNameBuffer[0]);
136
Geoff Lang5ed74cf2015-04-14 13:57:07 -0400137 std::string uniformName = gl::ParseUniformName(std::string(&uniformNameBuffer[0], uniformNameLength), nullptr);
138
139 for (size_t arrayIndex = 0; arrayIndex < static_cast<size_t>(uniformSize); arrayIndex++)
140 {
141 std::string locationName = uniformName;
142 if (uniformSize > 1)
143 {
144 locationName += "[" + Str(arrayIndex) + "]";
145 }
146
147 GLint location = mFunctions->getUniformLocation(mProgramID, locationName.c_str());
148 if (location >= 0)
149 {
Geoff Lang5ed74cf2015-04-14 13:57:07 -0400150 mUniformIndex[location] = gl::VariableLocation(uniformName, arrayIndex, static_cast<unsigned int>(mUniforms.size()));
Geoff Langf51bc792015-05-04 14:57:03 -0400151
152 // If the uniform is a sampler, track it in the sampler bindings array
153 if (gl::IsSamplerType(uniformType))
154 {
155 SamplerLocation samplerLoc;
156 samplerLoc.samplerIndex = mSamplerBindings.size();
157 samplerLoc.arrayIndex = arrayIndex;
158 mSamplerUniformMap[location] = samplerLoc;
159 }
Geoff Lang5ed74cf2015-04-14 13:57:07 -0400160 }
161 }
162
163 // ANGLE uses 0 to identify an non-array uniform.
164 unsigned int arraySize = (uniformSize > 1) ? static_cast<unsigned int>(uniformSize) : 0;
Geoff Langb1f435e2015-02-20 10:01:01 -0500165
166 // TODO: determine uniform precision
Geoff Lang5ed74cf2015-04-14 13:57:07 -0400167 mUniforms.push_back(new gl::LinkedUniform(uniformType, GL_NONE, uniformName, arraySize, -1, sh::BlockMemberInfo::getDefaultBlockInfo()));
Geoff Langf51bc792015-05-04 14:57:03 -0400168
169 // If uniform is a sampler type, insert it into the mSamplerBindings array
170 if (gl::IsSamplerType(uniformType))
171 {
172 SamplerBindingGL samplerBinding;
173 samplerBinding.textureType = gl::SamplerTypeToTextureType(uniformType);
174 samplerBinding.boundTextureUnits.resize(uniformSize, 0);
175 mSamplerBindings.push_back(samplerBinding);
176 }
Geoff Langb1f435e2015-02-20 10:01:01 -0500177 }
178
179 // Query the attribute information
180 GLint activeAttributeMaxLength = 0;
181 mFunctions->getProgramiv(mProgramID, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &activeAttributeMaxLength);
182
183 std::vector<GLchar> attributeNameBuffer(activeAttributeMaxLength);
184
185 GLint attributeCount = 0;
186 mFunctions->getProgramiv(mProgramID, GL_ACTIVE_ATTRIBUTES, &attributeCount);
187 for (GLint i = 0; i < attributeCount; i++)
188 {
189 GLsizei attributeNameLength = 0;
190 GLint attributeSize = 0;
191 GLenum attributeType = GL_NONE;
192 mFunctions->getActiveAttrib(mProgramID, i, attributeNameBuffer.size(), &attributeNameLength, &attributeSize, &attributeType, &attributeNameBuffer[0]);
193
194 std::string attributeName(&attributeNameBuffer[0], attributeNameLength);
195
Geoff Lang0ca53782015-05-07 13:49:39 -0400196 GLint location = mFunctions->getAttribLocation(mProgramID, attributeName.c_str());
197
Geoff Langb1f435e2015-02-20 10:01:01 -0500198 // TODO: determine attribute precision
Geoff Lang0ca53782015-05-07 13:49:39 -0400199 setShaderAttribute(static_cast<size_t>(i), attributeType, GL_NONE, attributeName, attributeSize, location);
Geoff Langb61e1732015-06-05 11:49:55 -0400200
201 mActiveAttributeLocations.push_back(location);
Geoff Langb1f435e2015-02-20 10:01:01 -0500202 }
203
204 return LinkResult(true, gl::Error(GL_NO_ERROR));
Geoff Langf9a6f082015-01-22 13:32:49 -0500205}
206
Geoff Lang0ca53782015-05-07 13:49:39 -0400207void ProgramGL::bindAttributeLocation(GLuint index, const std::string &name)
208{
209 mFunctions->bindAttribLocation(mProgramID, index, name.c_str());
210}
211
Geoff Langf9a6f082015-01-22 13:32:49 -0500212void ProgramGL::setUniform1fv(GLint location, GLsizei count, const GLfloat *v)
213{
Geoff Lang63cbace2015-02-26 10:03:12 -0500214 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500215 mFunctions->uniform1fv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500216}
217
218void ProgramGL::setUniform2fv(GLint location, GLsizei count, const GLfloat *v)
219{
Geoff Lang63cbace2015-02-26 10:03:12 -0500220 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500221 mFunctions->uniform2fv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500222}
223
224void ProgramGL::setUniform3fv(GLint location, GLsizei count, const GLfloat *v)
225{
Geoff Lang63cbace2015-02-26 10:03:12 -0500226 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500227 mFunctions->uniform3fv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500228}
229
230void ProgramGL::setUniform4fv(GLint location, GLsizei count, const GLfloat *v)
231{
Geoff Lang63cbace2015-02-26 10:03:12 -0500232 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500233 mFunctions->uniform4fv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500234}
235
236void ProgramGL::setUniform1iv(GLint location, GLsizei count, const GLint *v)
237{
Geoff Lang63cbace2015-02-26 10:03:12 -0500238 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500239 mFunctions->uniform1iv(location, count, v);
Geoff Langf51bc792015-05-04 14:57:03 -0400240
241 auto iter = mSamplerUniformMap.find(location);
242 if (iter != mSamplerUniformMap.end())
243 {
244 const SamplerLocation &samplerLoc = iter->second;
245 std::vector<GLuint> &boundTextureUnits = mSamplerBindings[samplerLoc.samplerIndex].boundTextureUnits;
246
247 size_t copyCount = std::max<size_t>(count, boundTextureUnits.size() - samplerLoc.arrayIndex);
248 std::copy(v, v + copyCount, boundTextureUnits.begin() + samplerLoc.arrayIndex);
249 }
Geoff Langf9a6f082015-01-22 13:32:49 -0500250}
251
252void ProgramGL::setUniform2iv(GLint location, GLsizei count, const GLint *v)
253{
Geoff Lang63cbace2015-02-26 10:03:12 -0500254 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500255 mFunctions->uniform2iv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500256}
257
258void ProgramGL::setUniform3iv(GLint location, GLsizei count, const GLint *v)
259{
Geoff Lang63cbace2015-02-26 10:03:12 -0500260 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500261 mFunctions->uniform3iv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500262}
263
264void ProgramGL::setUniform4iv(GLint location, GLsizei count, const GLint *v)
265{
Geoff Lang63cbace2015-02-26 10:03:12 -0500266 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500267 mFunctions->uniform4iv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500268}
269
270void ProgramGL::setUniform1uiv(GLint location, GLsizei count, const GLuint *v)
271{
Geoff Lang63cbace2015-02-26 10:03:12 -0500272 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500273 mFunctions->uniform1uiv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500274}
275
276void ProgramGL::setUniform2uiv(GLint location, GLsizei count, const GLuint *v)
277{
Geoff Lang63cbace2015-02-26 10:03:12 -0500278 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500279 mFunctions->uniform2uiv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500280}
281
282void ProgramGL::setUniform3uiv(GLint location, GLsizei count, const GLuint *v)
283{
Geoff Lang63cbace2015-02-26 10:03:12 -0500284 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500285 mFunctions->uniform3uiv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500286}
287
288void ProgramGL::setUniform4uiv(GLint location, GLsizei count, const GLuint *v)
289{
Geoff Lang63cbace2015-02-26 10:03:12 -0500290 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500291 mFunctions->uniform4uiv(location, count, v);
Geoff Langf9a6f082015-01-22 13:32:49 -0500292}
293
294void ProgramGL::setUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
295{
Geoff Lang63cbace2015-02-26 10:03:12 -0500296 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500297 mFunctions->uniformMatrix2fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500298}
299
300void ProgramGL::setUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
301{
Geoff Lang63cbace2015-02-26 10:03:12 -0500302 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500303 mFunctions->uniformMatrix3fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500304}
305
306void ProgramGL::setUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
307{
Geoff Lang63cbace2015-02-26 10:03:12 -0500308 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500309 mFunctions->uniformMatrix4fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500310}
311
312void ProgramGL::setUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
313{
Geoff Lang63cbace2015-02-26 10:03:12 -0500314 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500315 mFunctions->uniformMatrix2x3fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500316}
317
318void ProgramGL::setUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
319{
Geoff Lang63cbace2015-02-26 10:03:12 -0500320 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500321 mFunctions->uniformMatrix3x2fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500322}
323
324void ProgramGL::setUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
325{
Geoff Lang63cbace2015-02-26 10:03:12 -0500326 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500327 mFunctions->uniformMatrix2x4fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500328}
329
330void ProgramGL::setUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
331{
Geoff Lang63cbace2015-02-26 10:03:12 -0500332 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500333 mFunctions->uniformMatrix4x2fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500334}
335
336void ProgramGL::setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
337{
Geoff Lang63cbace2015-02-26 10:03:12 -0500338 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500339 mFunctions->uniformMatrix3x4fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500340}
341
342void ProgramGL::setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
343{
Geoff Lang63cbace2015-02-26 10:03:12 -0500344 mStateManager->useProgram(mProgramID);
Geoff Langb1f435e2015-02-20 10:01:01 -0500345 mFunctions->uniformMatrix4x3fv(location, count, transpose, value);
Geoff Langf9a6f082015-01-22 13:32:49 -0500346}
347
348void ProgramGL::getUniformfv(GLint location, GLfloat *params)
349{
Geoff Langb1f435e2015-02-20 10:01:01 -0500350 mFunctions->getUniformfv(mProgramID, location, params);
Geoff Langf9a6f082015-01-22 13:32:49 -0500351}
352
353void ProgramGL::getUniformiv(GLint location, GLint *params)
354{
Geoff Langb1f435e2015-02-20 10:01:01 -0500355 mFunctions->getUniformiv(mProgramID, location, params);
Geoff Langf9a6f082015-01-22 13:32:49 -0500356}
357
358void ProgramGL::getUniformuiv(GLint location, GLuint *params)
359{
Geoff Langb1f435e2015-02-20 10:01:01 -0500360 mFunctions->getUniformuiv(mProgramID, location, params);
Geoff Langf9a6f082015-01-22 13:32:49 -0500361}
362
363GLint ProgramGL::getSamplerMapping(gl::SamplerType type, unsigned int samplerIndex, const gl::Caps &caps) const
364{
365 UNIMPLEMENTED();
366 return GLint();
367}
368
369GLenum ProgramGL::getSamplerTextureType(gl::SamplerType type, unsigned int samplerIndex) const
370{
371 UNIMPLEMENTED();
372 return GLenum();
373}
374
375GLint ProgramGL::getUsedSamplerRange(gl::SamplerType type) const
376{
377 UNIMPLEMENTED();
378 return GLint();
379}
380
381void ProgramGL::updateSamplerMapping()
382{
383 UNIMPLEMENTED();
384}
385
386bool ProgramGL::validateSamplers(gl::InfoLog *infoLog, const gl::Caps &caps)
387{
Geoff Lang35d315c2015-03-31 12:48:54 -0400388 //UNIMPLEMENTED();
Geoff Langb1f435e2015-02-20 10:01:01 -0500389 return true;
Geoff Langf9a6f082015-01-22 13:32:49 -0500390}
391
392LinkResult ProgramGL::compileProgramExecutables(gl::InfoLog &infoLog, gl::Shader *fragmentShader, gl::Shader *vertexShader,
393 int registers)
394{
Geoff Langb1f435e2015-02-20 10:01:01 -0500395 //UNIMPLEMENTED();
396 return LinkResult(true, gl::Error(GL_NO_ERROR));
Geoff Langf9a6f082015-01-22 13:32:49 -0500397}
398
399bool ProgramGL::linkUniforms(gl::InfoLog &infoLog, const gl::Shader &vertexShader, const gl::Shader &fragmentShader,
400 const gl::Caps &caps)
401{
Geoff Langb1f435e2015-02-20 10:01:01 -0500402 //UNIMPLEMENTED();
403 return true;
Geoff Langf9a6f082015-01-22 13:32:49 -0500404}
405
406bool ProgramGL::defineUniformBlock(gl::InfoLog &infoLog, const gl::Shader &shader, const sh::InterfaceBlock &interfaceBlock,
407 const gl::Caps &caps)
408{
409 UNIMPLEMENTED();
410 return bool();
411}
412
413gl::Error ProgramGL::applyUniforms()
414{
Geoff Langc3ab9f72015-05-27 14:45:59 -0400415 //UNIMPLEMENTED();
416 // TODO(geofflang)
417 return gl::Error(GL_NO_ERROR);
Geoff Langf9a6f082015-01-22 13:32:49 -0500418}
419
Gregoire Payen de La Garanderie68694e92015-03-24 14:03:37 +0000420gl::Error ProgramGL::applyUniformBuffers(const gl::Data &data, GLuint uniformBlockBindings[])
Geoff Langf9a6f082015-01-22 13:32:49 -0500421{
422 UNIMPLEMENTED();
423 return gl::Error(GL_INVALID_OPERATION);
424}
425
426bool ProgramGL::assignUniformBlockRegister(gl::InfoLog &infoLog, gl::UniformBlock *uniformBlock, GLenum shader,
427 unsigned int registerIndex, const gl::Caps &caps)
428{
429 UNIMPLEMENTED();
430 return bool();
431}
432
Geoff Langb1f435e2015-02-20 10:01:01 -0500433void ProgramGL::reset()
434{
435 ProgramImpl::reset();
Geoff Langf51bc792015-05-04 14:57:03 -0400436
437 mSamplerUniformMap.clear();
438 mSamplerBindings.clear();
Geoff Langb61e1732015-06-05 11:49:55 -0400439 mActiveAttributeLocations.clear();
Geoff Langb1f435e2015-02-20 10:01:01 -0500440}
441
442GLuint ProgramGL::getProgramID() const
443{
444 return mProgramID;
445}
446
Geoff Langf51bc792015-05-04 14:57:03 -0400447const std::vector<SamplerBindingGL> &ProgramGL::getAppliedSamplerUniforms() const
448{
449 return mSamplerBindings;
450}
451
Geoff Langb61e1732015-06-05 11:49:55 -0400452const std::vector<GLuint> &ProgramGL::getActiveAttributeLocations() const
453{
454 return mActiveAttributeLocations;
455}
456
Geoff Langf9a6f082015-01-22 13:32:49 -0500457}