summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-07-23 15:51:13 -0400
committerRob Clark <[email protected]>2015-07-27 13:51:05 -0400
commit0815729d964f4e8e6e263acf70b5b91577de027a (patch)
tree80574c5835a27f93bda295cbe4f0c71da3fdbdb7 /src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
parentbc5e2bec303acd7fd962996bf369be5ce0e15cd2 (diff)
freedreno/ir3: bit of shader API refactoring
Since for transform-feedback, we'll need more than just the TGSI tokens from the state object, just pass the entire state object to ir3_shader_create(). This also cleans things up a bit for some day in the future when we could take shader either as TGSI or directly NIR (for ex, glsl2nir or spirv2nir paths). In the same spirit, drop extra args from ir3_compile_shader_nir() (since it can anyways get what it needs from the ir3_shader_variant). Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_cmdline.c')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_cmdline.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
index d2aabe1140d..68f08486075 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
@@ -181,10 +181,6 @@ int main(int argc, char **argv)
filename = argv[n];
- memset(&v, 0, sizeof(v));
- v.key = key;
- v.shader = &s;
-
ret = read_file(filename, &ptr, &size);
if (ret) {
print_usage();
@@ -197,6 +193,13 @@ int main(int argc, char **argv)
if (!tgsi_text_translate(ptr, toks, Elements(toks)))
errx(1, "could not parse `%s'", filename);
+ memset(&s, 0, sizeof(s));
+ s.tokens = toks;
+
+ memset(&v, 0, sizeof(v));
+ v.key = key;
+ v.shader = &s;
+
tgsi_parse_init(&parse, toks);
switch (parse.FullHeader.Processor.Processor) {
case TGSI_PROCESSOR_FRAGMENT:
@@ -214,7 +217,7 @@ int main(int argc, char **argv)
compiler = ir3_compiler_create(320);
info = "NIR compiler";
- ret = ir3_compile_shader_nir(compiler, &v, toks, key);
+ ret = ir3_compile_shader_nir(compiler, &v);
if (ret) {
fprintf(stderr, "compiler failed!\n");
return ret;