From a79eacaed7b8963e39bfa2c18ab5a83023792e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 4 May 2012 11:31:06 +0200 Subject: [PATCH] Properly detect effects which need OpenGL 2 Effects that need GLSL require that OpenGL 2 is active. It does not matter whether the GPU would support it if OpenGL 2 is not used. Cherry-picked from db42152 CCBUG: 299426 --- effects/explosion/explosion.cpp | 7 +++++-- effects/invert/invert.cpp | 7 +++++-- effects/lookingglass/lookingglass.cpp | 8 +++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/effects/explosion/explosion.cpp b/effects/explosion/explosion.cpp index 49c5d3add2..9d55b93564 100644 --- a/effects/explosion/explosion.cpp +++ b/effects/explosion/explosion.cpp @@ -60,8 +60,11 @@ ExplosionEffect::~ExplosionEffect() bool ExplosionEffect::supported() { - return GLPlatform::instance()->supports(GLSL) && - (effects->compositingType() == OpenGLCompositing); + if (effects->compositingType() == OpenGLCompositing) { + return ShaderManager::instance()->isValid(); + } else { + return false; + } } bool ExplosionEffect::loadData() diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index 3ac78a7dc0..258e2ecadd 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -64,8 +64,11 @@ InvertEffect::~InvertEffect() bool InvertEffect::supported() { - return GLPlatform::instance()->supports(GLSL) && - (effects->compositingType() == OpenGLCompositing); + if (effects->compositingType() == OpenGLCompositing) { + return ShaderManager::instance()->isValid(); + } else { + return false; + } } bool InvertEffect::loadData() diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index c62e2687eb..6ebd7a10ab 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -79,9 +79,11 @@ LookingGlassEffect::~LookingGlassEffect() bool LookingGlassEffect::supported() { - return GLRenderTarget::supported() && - GLPlatform::instance()->supports(GLSL) && - (effects->compositingType() == OpenGLCompositing); + if (effects->compositingType() == OpenGLCompositing) { + return ShaderManager::instance()->isValid() && GLRenderTarget::supported(); + } else { + return false; + } } void LookingGlassEffect::reconfigure(ReconfigureFlags)