diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index dcde3f006..85946d598 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -151,6 +151,7 @@ void gl_LoadExtensions() { double v1 = strtod(version, NULL); double v2 = strtod(glversion, NULL); + if (v1 >= 3.0 && v1 < 3.3) v1 = 3.3; // promote '3' to 3.3 to avoid falling back to the legacy path. if (v2 < v1) version = glversion; else Printf("Emulating OpenGL v %s\n", version); } @@ -204,8 +205,9 @@ void gl_LoadExtensions() gl.flags |= RFL_SAMPLER_OBJECTS; } - // The minimum requirement for the modern render path are GL 3.0 + uniform buffers. Also exclude the Linux Mesa driver at GL 3.0 because it errors out on shader compilation. - if (gl_version < 3.0f || (gl_version < 3.1f && (!CheckExtension("GL_ARB_uniform_buffer_object") || strstr(gl.vendorstring, "X.Org") != nullptr))) + // The minimum requirement for the modern render path is GL 3.3. + // Although some GL 3.1 or 3.2 solutions may theoretically work they are usually too broken or too slow. + if (gl_version < 3.3f) { gl.legacyMode = true; gl.lightmethod = LM_LEGACY; @@ -213,16 +215,6 @@ void gl_LoadExtensions() gl.glslversion = 0; gl.flags |= RFL_NO_CLIP_PLANES; } - else if (gl.glslversion < 1.4f && !CheckExtension("GL_ARB_uniform_buffer_object")) - { - // Some old ATI drivers report OpenGL 3.1 with GLSL version 1.3 and no support for uniform buffers. - // We have no choice but to force them down to OpenGL 2.x. - gl.legacyMode = true; - gl.lightmethod = LM_LEGACY; - gl.buffermethod = BM_LEGACY; - gl.glslversion = 0; - gl.flags |= RFL_NO_CLIP_PLANES; - } else { gl.legacyMode = false; diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index ed833e883..b51be142e 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -530,7 +530,7 @@ NSOpenGLPixelFormat* CreatePixelFormat(const OpenGLProfile profile) if (nullptr != glversion) { const double version = strtod(glversion, nullptr) + 0.01; - if (version < 3.2) + if (version < 3.0) { profile = NSOpenGLProfileVersionLegacy; } diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 614adaa2d..8071399db 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -877,7 +877,7 @@ bool Win32GLVideo::InitHardware (HWND Window, int multisample) int prof = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; const char *version = Args->CheckValue("-glversion"); - if (version != nullptr && strcmp(version, "3.0") < 0) prof = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + if (version != nullptr && strtod(version, nullptr) < 3.0) prof = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; for (; prof <= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; prof++) {