summaryrefslogtreecommitdiff
path: root/src/opengl/qglshaderprogram.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-09 14:23:53 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-09 14:23:53 +0200
commit850c3f7d9bb5fbad041dd935d1d53c5d49db0163 (patch)
tree3ebb00088919d21c51c34b3c002c41b3fd1bedbe /src/opengl/qglshaderprogram.cpp
parent19a566f82a7c684423331a8caab70ec594afd1ce (diff)
parent64a360f45ab9a1c50ca628cfd6b670b93816c756 (diff)
downloadqt4-tools-850c3f7d9bb5fbad041dd935d1d53c5d49db0163.tar.gz
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: src/multimedia/audio/qaudioinput_win32_p.h
Diffstat (limited to 'src/opengl/qglshaderprogram.cpp')
-rw-r--r--src/opengl/qglshaderprogram.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 55fd922935..83b4b215ce 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -999,17 +999,18 @@ GLuint QGLShaderProgram::programId() const
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
{
Q_D(QGLShaderProgram);
- if (!d->linked) {
- glBindAttribLocation(d->programGuard.id(), location, name);
- } else {
- qWarning() << "QGLShaderProgram::bindAttributeLocation(" << name
- << "): cannot bind after shader program is linked";
- }
+ if (!init())
+ return;
+ glBindAttribLocation(d->programGuard.id(), location, name);
+ d->linked = false; // Program needs to be relinked.
}
/*!
@@ -1020,6 +1021,9 @@ void QGLShaderProgram::bindAttributeLocation(const char *name, int location)
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location)
@@ -1035,6 +1039,9 @@ void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int locatio
Any attributes that have not been explicitly bound when the program
is linked will be assigned locations automatically.
+ When this function is called after the program has been linked,
+ the program will need to be relinked for the change to take effect.
+
\sa attributeLocation()
*/
void QGLShaderProgram::bindAttributeLocation(const QString& name, int location)