diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-07-24 00:27:00 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-07-24 00:27:00 (GMT) |
commit | 92c19412b5a4178436defee2900119cc05fed191 (patch) | |
tree | e7d2497fcb97a210319d9f2a35ce2ff570d82166 | |
parent | 2d868c78f3da4757188cf014b2dac9d8a75f9991 (diff) | |
download | Qt-92c19412b5a4178436defee2900119cc05fed191.zip Qt-92c19412b5a4178436defee2900119cc05fed191.tar.gz Qt-92c19412b5a4178436defee2900119cc05fed191.tar.bz2 |
Make ordinary shaders work again after custom shader changes.
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index 327a699..c110c50 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -131,6 +131,7 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) code[ImageSrcFragmentShader] = qglslImageSrcFragmentShader; code[ImageSrcWithPatternFragmentShader] = qglslImageSrcWithPatternFragmentShader; code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader; + code[CustomImageSrcFragmentShader] = ""; // Supplied by app. code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader; code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader; code[TextureBrushSrcWithPatternFragmentShader] = qglslTextureBrushSrcWithPatternFragmentShader; @@ -547,7 +548,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg() } // If the shader program's not found in the cache, create it now. - while (!foundProgramInCache) { + if (!foundProgramInCache) { requiredProgram.program = new QGLShaderProgram(ctx, this); requiredProgram.program->addShader(requiredProgram.mainVertexShader); requiredProgram.program->addShader(requiredProgram.positionVertexShader); @@ -579,13 +580,12 @@ bool QGLEngineShaderManager::useCorrectShaderProg() << " " << requiredProgram.program->log(); qWarning() << error; delete requiredProgram.program; - break; + } else { + cachedPrograms.append(requiredProgram); + // taking the address here is safe since + // cachePrograms isn't resized anywhere else + currentShaderProg = &cachedPrograms.last(); } - - cachedPrograms.append(requiredProgram); - // taking the address here is safe since - // cachePrograms isn't resized anywhere else - currentShaderProg = &cachedPrograms.last(); } if (currentShaderProg) { |