diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index 095cd5dad..b48868a38 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -59,8 +59,8 @@ void GPU_HW_ShaderGen::SetGLSLVersionString() } char buf[128]; - 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" : "")); + std::snprintf(buf, sizeof(buf), "#version %d%02d%s", major_version, minor_version, + (m_glsl_es && major_version >= 3) ? " es" : ""); m_glsl_version_string = buf; } diff --git a/src/duckstation-qt/opengldisplaywindow.cpp b/src/duckstation-qt/opengldisplaywindow.cpp index e1a412ad4..d93f4f75e 100644 --- a/src/duckstation-qt/opengldisplaywindow.cpp +++ b/src/duckstation-qt/opengldisplaywindow.cpp @@ -174,7 +174,20 @@ void OpenGLDisplayWindow::WindowResized() {} 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 diff --git a/src/duckstation-sdl/opengl_host_display.cpp b/src/duckstation-sdl/opengl_host_display.cpp index 9075ea199..5948b9857 100644 --- a/src/duckstation-sdl/opengl_host_display.cpp +++ b/src/duckstation-sdl/opengl_host_display.cpp @@ -143,7 +143,20 @@ void OpenGLHostDisplay::WindowResized() 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