Ensure that always one shader is on the ShaderStack with GL2

This brings some consistency with GLES2 where also one shader
is always on the stack and allows to use the test whether a shader
is bound to see if the GL2 code path is used. This fixes an issue
with cover/flip switch which tested for a bound shader before the
shader was pushed in multi screen setups.

As well it should bring some improvements as the simple screen
shader is not unbound and rebound in each rendered frame.

BUG: 283609
FIXED-IN: 4.7.3
This commit is contained in:
Martin Gräßlin 2011-10-15 09:47:56 +02:00
parent eda72d6475
commit e6ed00123a

View file

@ -92,6 +92,10 @@ SceneOpenGL::SceneOpenGL(Workspace* ws)
if (GLPlatform::instance()->supports(GLSL)) { if (GLPlatform::instance()->supports(GLSL)) {
if (!ShaderManager::instance()->isValid()) { if (!ShaderManager::instance()->isValid()) {
kDebug(1212) << "No Scene Shaders available"; kDebug(1212) << "No Scene Shaders available";
} else {
// push one shader on the stack so that one is always bound
// consistency with GLES
ShaderManager::instance()->pushShader(ShaderManager::SimpleShader);
} }
} }