Commit 5241a199 authored by Rob Clark's avatar Rob Clark

Set more env-var's in run.c

Simplify the instructions a bit by setting all the potentially needed
environment variables in run.c itself.

Made very trivially more complex by the fact that all of the gallium
drivers are using u_debug stuff, so one env var contains potentially
multiple flags.  We don't want to clobber any other flags that are set
so we simply append.
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 9f6e675d
......@@ -37,7 +37,7 @@ to run.
=== Running shaders ===
ST_DEBUG=precompile R600_DEBUG=ps,vs,gs,precompile ./run shaders -1 2> new-run
./run shaders -1 2> new-run
Note that a debug mesa build required (ie. --enable-debug)
......@@ -50,7 +50,7 @@ Note that a debug mesa build required (ie. --enable-debug)
=== Running shaders ===
FD_MESA_DEBUG=shaderdb ST_DEBUG=precompile ./run -1 shaders 2> new-run
./run -1 shaders 2> new-run
Note that a debug mesa build required (ie. --enable-debug)
......
......@@ -23,13 +23,15 @@
* DEALINGS IN THE SOFTWARE.
*/
/* for memmem(). The man page doesn't say __USE_GNU... */
/* also for asprintf() */
#define _GNU_SOURCE
#include <time.h>
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
#include <signal.h>
/* for memmem(). The man page doesn't say __USE_GNU... */
#define __USE_GNU
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -292,6 +294,19 @@ void print_usage(const char *prog_name)
prog_name);
}
static void addenv(const char *name, const char *value)
{
const char *orig = getenv(name);
if (orig) {
char *newval;
asprintf(&newval, "%s,%s", orig, value);
setenv(name, newval, 1);
free(newval);
} else {
setenv(name, value, 1);
}
}
int
main(int argc, char **argv)
{
......@@ -340,6 +355,9 @@ main(int argc, char **argv)
setenv("allow_glsl_extension_directive_midshader", "true", 1);
setenv("shader_precompile", "true", 1);
addenv("ST_DEBUG", "precompile");
addenv("R600_DEBUG", "ps,vs,gs,precompile");
addenv("FD_MESA_DEBUG", "shaderdb");
const char *client_extensions = eglQueryString(EGL_NO_DISPLAY,
EGL_EXTENSIONS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment