summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-31 10:55:09 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-31 10:55:09 (GMT)
commitb2d8bca28e1ea485c9ebbe02566cc099c33d8458 (patch)
tree3b6bcb0107d2c78491a92ca81b4d5a0e052135ed
parent287a8d25b0e13602d02abc301e64060f46fff0e9 (diff)
parentca51a4aab9f6b91b034a3b269718165b56883285 (diff)
downloadQt-b2d8bca28e1ea485c9ebbe02566cc099c33d8458.zip
Qt-b2d8bca28e1ea485c9ebbe02566cc099c33d8458.tar.gz
Qt-b2d8bca28e1ea485c9ebbe02566cc099c33d8458.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Allow attributes to be bound after a QGLShaderProgram is linked.
-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 79484fa..bbfc2d5 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -969,17 +969,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.
}
/*!
@@ -990,6 +991,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)
@@ -1005,6 +1009,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)