[declarativeimports/core] Do not crash if FadingMaterialShader failed to complie

Without GLSL our shader doesn't compile and Qt aborts when accessing the
uniforms. We don't want that, abort is never nice.

BUG: 336272
REVIEW: 118813
This commit is contained in:
Martin Gräßlin 2014-06-18 14:13:42 +02:00
parent 1f633ad0a1
commit d7d71e8a66

View File

@ -101,6 +101,10 @@ void FadingMaterialShader::updateState(const FadingMaterialState* newState, cons
void FadingMaterialShader::initialize()
{
if (!program()->isLinked()) {
// shader not linked, exit otherwise we crash, BUG: 336272
return;
}
QSGSimpleMaterialShader< FadingMaterialState >::initialize();
glFuncs = QOpenGLContext::currentContext()->functions();
program()->bind();