summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video/opengl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp
index 4d590facc..ebe4bb8d7 100644
--- a/src/video/opengl.cpp
+++ b/src/video/opengl.cpp
@@ -15,6 +15,8 @@
// #define NO_GL_BUFFER_SYNC
/* Define to enable persistent buffer mapping on AMD GPUs. */
// #define GL_MAP_PERSISTENT_AMD
+/* Define to allow software rendering backends. */
+// #define GL_ALLOW_SOFTWARE_RENDERER
#if defined(_WIN32)
# include <windows.h>
@@ -536,6 +538,12 @@ const char *OpenGLBackend::Init()
DEBUG(driver, 1, "OpenGL driver: %s - %s (%s)", vend, renderer, ver);
+#ifndef GL_ALLOW_SOFTWARE_RENDERER
+ /* Don't use MESA software rendering backends as they are slower than
+ * just using a non-OpenGL video driver. */
+ if (strncmp(renderer, "llvmpipe", 8) == 0 || strncmp(renderer, "softpipe", 8) == 0) return "Software renderer detected, not using OpenGL";
+#endif
+
const char *minor = strchr(ver, '.');
_gl_major_ver = atoi(ver);
_gl_minor_ver = minor != nullptr ? atoi(minor + 1) : 0;