summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-09-16 13:57:26 -0400
committerRob Clark <[email protected]>2015-09-17 19:57:52 -0400
commitc70ed861722c45753ae9a24cf4c00643f0640e2f (patch)
treef9538b5bd75a61e8e283cda0cb77ab4ac7ca1f5d /src/gallium/drivers/freedreno/ir3
parentc970ec0577649e2f1b0532c2a62e279b784f8687 (diff)
freedreno/ir3: add --gpu arg to cmdline compiler
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_cmdline.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
index cbf748a00df..e768e6133a8 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
@@ -95,6 +95,7 @@ static void print_usage(void)
printf(" --saturate-r MASK - bitmask of samplers to saturate R coord\n");
printf(" --stream-out - enable stream-out (aka transform feedback)\n");
printf(" --ucp MASK - bitmask of enabled user-clip-planes\n");
+ printf(" --gpu GPU_ID - specify gpu-id (default 320)\n");
printf(" --help - show this message\n");
}
@@ -108,6 +109,7 @@ int main(int argc, char **argv)
struct ir3_shader_variant v;
struct ir3_shader s;
struct ir3_shader_key key = {};
+ unsigned gpu_id = 320;
const char *info;
void *ptr;
size_t size;
@@ -198,6 +200,13 @@ int main(int argc, char **argv)
continue;
}
+ if (!strcmp(argv[n], "--gpu")) {
+ debug_printf(" %s %s", argv[n], argv[n+1]);
+ gpu_id = strtol(argv[n+1], NULL, 0);
+ n += 2;
+ continue;
+ }
+
if (!strcmp(argv[n], "--help")) {
print_usage();
return 0;
@@ -240,7 +249,7 @@ int main(int argc, char **argv)
}
/* TODO cmdline option to target different gpus: */
- compiler = ir3_compiler_create(320);
+ compiler = ir3_compiler_create(gpu_id);
info = "NIR compiler";
ret = ir3_compile_shader_nir(compiler, &v);