glx: turn LIBGL_ALWAYS_INDIRECT into a boolean
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 8 Sep 2017 10:53:47 +0000 (11:53 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 12 Sep 2017 12:53:12 +0000 (13:53 +0100)
Instead of setting based on set/unset, allow users to use boolean values.
In the docs, use `ALWAYS=true` instead of `ALWAYS=1` as it's clearer IMO.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
docs/envvars.html
docs/libGL.txt
src/glx/glxext.c

index b70528fa467eb52ff8abdd75a3ac8ad089270e13..aeb5ff284784d74e63c0603f8da482a7a4939a79 100644 (file)
@@ -29,7 +29,7 @@ sometimes be useful for debugging end-user issues.
 <li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
    If set to 'verbose' additional information will be printed.
 <li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
-<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
+<li>LIBGL_ALWAYS_INDIRECT - if set to `true`, forces an indirect rendering context/connection.
 <li>LIBGL_ALWAYS_SOFTWARE - if set to `true`, always use software rendering
 <li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
 <li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
index 839e330cf06d950ee9002c366a19803cc71e8fb9..b69b8c07fcb2b358767ab49d2eada442f6683dc3 100644 (file)
@@ -59,7 +59,7 @@ to learn if it is thread safe.
 Indirect Rendering
 
 You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT
-environment variable.  Hardware acceleration will not be used.
+environment variable to `true`.  Hardware acceleration will not be used.
 
 
 
index cd9a3ba6ba0db9c356f17bb53e4c611af77e78d6..40219397129219695a99a0470cc496bc9e2ea209 100644 (file)
@@ -907,7 +907,7 @@ __glXInitialize(Display * dpy)
    dpyPriv->glXDrawHash = __glxHashCreate();
 
 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-   glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
+   glx_direct = !env_var_as_boolean("LIBGL_ALWAYS_INDIRECT", false);
    glx_accel = !env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
 
    dpyPriv->drawHash = __glxHashCreate();