Set GLSL version for GLES.

It's not 100% true because GLES has different versions numbering. For example it doesn't have geometry shaders even if they were introduced in GLSL 1.50 (OpenGL 3.2).
But still in this way we make sure that it uses the same features on all devices, no mater if it's GLES 3.0, 3.1, 3.2 etc.
This commit is contained in:
deve 2017-02-01 10:30:46 +01:00
parent 93d6b1e515
commit 3c8369b915

View File

@ -91,7 +91,7 @@ void CentralVideoSettings::init()
std::string driver((char*)(glGetString(GL_VERSION)));
std::string card((char*)(glGetString(GL_RENDERER)));
GraphicsRestrictions::init(driver, card);
if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FORCE_LEGACY_DEVICE))
{
m_glsl = false;
@ -259,12 +259,19 @@ void CentralVideoSettings::init()
unsigned CentralVideoSettings::getGLSLVersion() const
{
#if defined(USE_GLES2)
if (m_gl_major_version >= 3)
return 300;
else
return 100;
#else
if (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version == 3))
return m_gl_major_version * 100 + m_gl_minor_version * 10;
else if (m_gl_major_version == 3)
return 100 + (m_gl_minor_version + 3) * 10;
else
return 120;
#endif
}
bool CentralVideoSettings::isGLSL() const