diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-16 14:56:15 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-16 14:56:15 (GMT) |
commit | d202681aa857cce2468c95676a56c9133a8f226c (patch) | |
tree | 15025d146d18c89043668852783e0a825ab3adaf /src/opengl | |
parent | a31aa886f29ab49bb0aa757ce2253aa4e8ef3632 (diff) | |
download | Qt-d202681aa857cce2468c95676a56c9133a8f226c.zip Qt-d202681aa857cce2468c95676a56c9133a8f226c.tar.gz Qt-d202681aa857cce2468c95676a56c9133a8f226c.tar.bz2 |
Avoid using uncompatible vertex shader for non-solid brushes
The simplified vertex shader for complex geometry is written
specifically for solid brushes and needs to be disabled when the
brush is anything else. This work-around can be removed later when
QTBUG-9069 is handled, since that removes the extra requirements on
the setPosition() shader.
Reviewed-by: tom
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index aa704b1..ac25597 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -328,7 +328,7 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS newProg->program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); if (newProg->useOpacityAttribute) newProg->program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR); - if (newProg->usePmvMatrix) { + if (newProg->usePmvMatrixAttribute) { newProg->program->bindAttributeLocation("pmvMatrix1", QT_PMV_MATRIX_1_ATTR); newProg->program->bindAttributeLocation("pmvMatrix2", QT_PMV_MATRIX_2_ATTR); newProg->program->bindAttributeLocation("pmvMatrix3", QT_PMV_MATRIX_3_ATTR); @@ -753,9 +753,16 @@ bool QGLEngineShaderManager::useCorrectShaderProg() } requiredProgram.useTextureCoords = texCoords; requiredProgram.useOpacityAttribute = (opacityMode == AttributeOpacity); - requiredProgram.usePmvMatrix = true; - if (complexGeometry) + if (complexGeometry && srcPixelType == Qt::SolidPattern) { requiredProgram.positionVertexShader = QGLEngineSharedShaders::ComplexGeometryPositionOnlyVertexShader; + requiredProgram.usePmvMatrixAttribute = false; + } else { + requiredProgram.usePmvMatrixAttribute = true; + + // Force complexGeometry off, since we currently don't support that mode for + // non-solid brushes + complexGeometry = false; + } // At this point, requiredProgram is fully populated so try to find the program in the cache currentShaderProg = sharedShaders->findProgramInCache(requiredProgram); |