diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp index 8f470d3e..d30fe734 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp @@ -415,8 +415,10 @@ public: { if (_glinfo.isGLES2) { m_part = "#version 100 \n"; - m_part += "#extension GL_EXT_shader_texture_lod : enable \n"; - m_part += "#extension GL_OES_standard_derivatives : enable \n"; + if (config.generalEmulation.enableLOD) { + m_part += "#extension GL_EXT_shader_texture_lod : enable \n"; + m_part += "#extension GL_OES_standard_derivatives : enable \n"; + } m_part += "#if (__VERSION__ > 120) \n" "# define IN in \n" diff --git a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp index 42074956..0759bdaa 100644 --- a/src/Graphics/OpenGLContext/opengl_GLInfo.cpp +++ b/src/Graphics/OpenGLContext/opengl_GLInfo.cpp @@ -75,4 +75,10 @@ void GLInfo::init() { LOG(LOG_WARNING, "Async color buffer copies are not supported on GLES2\n"); } #endif + if (isGLES2 && config.generalEmulation.enableLOD) { + if (!Utils::isExtensionSupported(*this, "GL_EXT_shader_texture_lod") || !Utils::isExtensionSupported(*this, "GL_OES_standard_derivatives")) { + config.generalEmulation.enableLOD = 0; + LOG(LOG_WARNING, "LOD emulation not possible on this device\n"); + } + } }