- made OpenGL 3.3 a requirement for running the modern render path. Also force '-glversion 3' to use the modern render path, even though actual OpenGL 3.0 won't support it.

This will exclude Intel HD3000 and many obsolete drivers for NVidia and ATI which should have been updated long ago.
This commit is contained in:
Christoph Oelckers 2017-06-28 17:57:04 +02:00
parent 9c3361dfe2
commit c74356a1c0
3 changed files with 6 additions and 14 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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++)
{