1
# Description: force llvmpipe in the unity profile if we are in the grey zone,
2
# meaning: the card and drivers have opengl support, however,
3
# it doesn't met unity requirements (opengl < 1.4, no vertex
5
# Forwarded: not-needed
6
# Bug: https://launchpad.net/bugs/1039155
7
# Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
8
=== modified file 'src/plugin.cpp'
9
--- old/src/plugin.cpp 2012-07-30 10:15:41 +0000
10
+++ new/src/plugin.cpp 2012-10-09 10:52:12 +0000
15
+setOpenGLPluginEnvironment ()
18
+ * Check if the hardware is adequate for Unity and if not, use LLVMpipe.
19
+ * Unfortunately the design of Mesa requires that this be done before
20
+ * libGL is loaded, which means before the opengl plugin is loaded.
22
+ bool toggledLLVM = false;
24
+ if (!getenv ("LIBGL_ALWAYS_SOFTWARE"))
26
+ const char *profile = getenv ("COMPIZ_CONFIG_PROFILE");
27
+ if (profile && !strcmp (profile, "ubuntu"))
29
+ int result = system ("/usr/lib/nux/unity_support_test");
30
+ int status = WEXITSTATUS (result);
31
+ compLogMessage ("core", CompLogLevelInfo,
33
+ status == 0 ? "fully supported by your hardware." :
34
+ status == 127 ? "undetectable" :
35
+ "not supported by your hardware. "
36
+ "Enabling software rendering instead (slow).");
37
+ if (status > 0 && status < 127)
39
+ setenv ("LIBGL_ALWAYS_SOFTWARE", "1", 1);
49
+unsetUnityshellPluginEnvironment ()
51
+ unsetenv ("LIBGL_ALWAYS_SOFTWARE");
55
+setPluginEnvironment (const char *name)
57
+ if (!strcmp (name, "opengl"))
58
+ setOpenGLPluginEnvironment ();
62
+unsetPluginEnvironment (const char *name)
64
+ if (!strcmp (name, "unityshell"))
65
+ unsetUnityshellPluginEnvironment ();
69
dlloaderLoadPlugin (CompPlugin *p,
73
if (cloaderLoadPlugin (p, path, name))
76
+ setPluginEnvironment (name);
82
if (!loaded && dlhand)
85
+ unsetPluginEnvironment (name);