Don't require OpenGL compatibility profile

This commit is contained in:
Connor McLaughlin 2020-02-15 21:11:51 +09:00
parent 1c17d5495e
commit f5482cb3b6
3 changed files with 30 additions and 4 deletions

View file

@ -60,7 +60,7 @@ void GPU_HW_ShaderGen::SetGLSLVersionString()
char buf[128]; char buf[128];
std::snprintf(buf, sizeof(buf), "#version %d%02d%s", major_version, minor_version, std::snprintf(buf, sizeof(buf), "#version %d%02d%s", major_version, minor_version,
(!m_glsl_es && major_version >= 3 && minor_version >= 3) ? "core" : (m_glsl_es ? "es" : "")); (m_glsl_es && major_version >= 3) ? " es" : "");
m_glsl_version_string = buf; m_glsl_version_string = buf;
} }

View file

@ -174,7 +174,20 @@ void OpenGLDisplayWindow::WindowResized() {}
const char* OpenGLDisplayWindow::GetGLSLVersionString() const const char* OpenGLDisplayWindow::GetGLSLVersionString() const
{ {
return m_gl_context->isOpenGLES() ? "#version 300 es" : "#version 130\n"; if (m_gl_context->isOpenGLES())
{
if (GLAD_GL_ES_VERSION_3_0)
return "#version 300 es";
else
return "#version 100";
}
else
{
if (GLAD_GL_VERSION_3_3)
return "#version 330";
else
return "#version 130";
}
} }
std::string OpenGLDisplayWindow::GetGLSLVersionHeader() const std::string OpenGLDisplayWindow::GetGLSLVersionHeader() const

View file

@ -143,7 +143,20 @@ void OpenGLHostDisplay::WindowResized()
const char* OpenGLHostDisplay::GetGLSLVersionString() const const char* OpenGLHostDisplay::GetGLSLVersionString() const
{ {
return m_is_gles ? "#version 300 es" : "#version 130\n"; if (m_is_gles)
{
if (GLAD_GL_ES_VERSION_3_0)
return "#version 300 es";
else
return "#version 100";
}
else
{
if (GLAD_GL_VERSION_3_3)
return "#version 330";
else
return "#version 130";
}
} }
std::string OpenGLHostDisplay::GetGLSLVersionHeader() const std::string OpenGLHostDisplay::GetGLSLVersionHeader() const