diff options
-rw-r--r-- | src/effects/shadereffectitem.cpp | 9 | ||||
-rw-r--r-- | src/effects/shadereffectitem.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/effects/shadereffectitem.cpp b/src/effects/shadereffectitem.cpp index 60af776..fe53cb9 100644 --- a/src/effects/shadereffectitem.cpp +++ b/src/effects/shadereffectitem.cpp @@ -188,6 +188,8 @@ ShaderEffectSource::ShaderEffectSource(QObject *parent) , m_refs(0) , m_dirtyTexture(true) , m_dirtySceneGraph(true) + , m_multisamplingSupported(false) + , m_checkedForMultisamplingSupport(false) { m_context = QSGContext::current; } @@ -404,11 +406,12 @@ void ShaderEffectSource::update() Q_ASSERT(m_renderer); const QGLContext *ctx = m_context->glContext(); - if (m_renderer->openGLFeatures() == 0) { - m_renderer->initializeGLFunctions(ctx); + + if (!m_checkedForMultisamplingSupport) { QList<QByteArray> extensions = QByteArray((const char *)glGetString(GL_EXTENSIONS)).split(' '); m_multisamplingSupported = extensions.contains("GL_EXT_framebuffer_multisample") - && extensions.contains("GL_EXT_framebuffer_blit"); + && extensions.contains("GL_EXT_framebuffer_blit"); + m_checkedForMultisamplingSupport = true; } if (!m_fbo) { diff --git a/src/effects/shadereffectitem.h b/src/effects/shadereffectitem.h index a1db89a..6fd7415 100644 --- a/src/effects/shadereffectitem.h +++ b/src/effects/shadereffectitem.h @@ -175,6 +175,7 @@ private: uint m_dirtyTexture : 1; // Causes update no matter what. uint m_dirtySceneGraph : 1; // Causes update if not static. uint m_multisamplingSupported : 1; + uint m_checkedForMultisamplingSupport : 1; }; class ShaderEffectNode : public GeometryNode |