diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-03-27 02:22:04 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-03-27 02:22:04 (GMT) |
commit | 58cbec72215d795948f7ed06cd9e6f199776806b (patch) | |
tree | 2d0b68339aee0f7bcd919fc7ae48b643fa1e42fb /src/opengl | |
parent | 732f3d1e2c8f63972a9a1ca477d1a9ac34361534 (diff) | |
download | Qt-58cbec72215d795948f7ed06cd9e6f199776806b.zip Qt-58cbec72215d795948f7ed06cd9e6f199776806b.tar.gz Qt-58cbec72215d795948f7ed06cd9e6f199776806b.tar.bz2 |
Bug in QGLShaderProgram::addShader() that stopped partial shaders working.
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qglshaderprogram.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 934b5a5..3c19434 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -849,13 +849,16 @@ bool QGLShaderProgram::addShader(QGLShader *shader) return false; if (d->shaders.contains(shader)) return true; // Already added to this shader program. - if (d->program && shader && shader->d->shader) { + if (d->program && shader) { if (!shader->d->compiled) return false; - if (!shader->d->isPartial) + if (!shader->d->isPartial) { + if (!shader->d->shader) + return false; glAttachShader(d->program, shader->d->shader); - else + } else { d->hasPartialShaders = true; + } d->linked = false; // Program needs to be relinked. d->shaders.append(shader); return true; |