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:
parent
93d6b1e515
commit
3c8369b915
@ -91,7 +91,7 @@ void CentralVideoSettings::init()
|
|||||||
std::string driver((char*)(glGetString(GL_VERSION)));
|
std::string driver((char*)(glGetString(GL_VERSION)));
|
||||||
std::string card((char*)(glGetString(GL_RENDERER)));
|
std::string card((char*)(glGetString(GL_RENDERER)));
|
||||||
GraphicsRestrictions::init(driver, card);
|
GraphicsRestrictions::init(driver, card);
|
||||||
|
|
||||||
if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FORCE_LEGACY_DEVICE))
|
if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FORCE_LEGACY_DEVICE))
|
||||||
{
|
{
|
||||||
m_glsl = false;
|
m_glsl = false;
|
||||||
@ -259,12 +259,19 @@ void CentralVideoSettings::init()
|
|||||||
|
|
||||||
unsigned CentralVideoSettings::getGLSLVersion() const
|
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))
|
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;
|
return m_gl_major_version * 100 + m_gl_minor_version * 10;
|
||||||
else if (m_gl_major_version == 3)
|
else if (m_gl_major_version == 3)
|
||||||
return 100 + (m_gl_minor_version + 3) * 10;
|
return 100 + (m_gl_minor_version + 3) * 10;
|
||||||
else
|
else
|
||||||
return 120;
|
return 120;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CentralVideoSettings::isGLSL() const
|
bool CentralVideoSettings::isGLSL() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user