freedreno: Remove the ir3_tgsi_to_nir() helper function.
authorEric Anholt <eric@anholt.net>
Tue, 14 May 2019 00:06:47 +0000 (17:06 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 16 May 2019 17:25:18 +0000 (10:25 -0700)
It was more of a hindrance, as it pretended that we could compile in the
driver with a missing screen.

Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Eduardo Lima Mitev <elima@igalia.com>
src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
src/gallium/drivers/freedreno/ir3/ir3_gallium.c
src/gallium/drivers/freedreno/ir3/ir3_gallium.h

index 1481c08df14f1661a61c6d5e3e248e9cf48e679f..d45f5afec8be6c481027d0de51c14b31a0efa2b6 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdio.h>
 #include <err.h>
 
+#include "nir/tgsi_to_nir.h"
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_text.h"
 #include "tgsi/tgsi_dump.h"
@@ -452,6 +453,8 @@ int main(int argc, char **argv)
 
        if (s.from_tgsi) {
                struct tgsi_token toks[65536];
+               const nir_shader_compiler_options *nir_options =
+                       ir3_get_compiler_options(compiler);
 
                ret = read_file(filenames[0], &ptr, &size);
                if (ret) {
@@ -468,7 +471,7 @@ int main(int argc, char **argv)
                if (ir3_shader_debug & IR3_DBG_OPTMSGS)
                        tgsi_dump(toks, 0);
 
-               nir = ir3_tgsi_to_nir(compiler, toks, NULL);
+               nir = tgsi_to_nir_noscreen(toks, nir_options);
                NIR_PASS_V(nir, nir_lower_global_vars_to_local);
        } else if (from_spirv) {
                nir = load_spirv(filenames[0], entry, stage);
index e605e531ecbad98d9b76f64b38034c9ebddac455..98db2bfa75c8f4de55b6d2fb945d1ac9e39c66d5 100644 (file)
@@ -133,7 +133,7 @@ ir3_shader_create(struct ir3_compiler *compiler,
                if (ir3_shader_debug & IR3_DBG_DISASM) {
                        tgsi_dump(cso->tokens, 0);
                }
-               nir = ir3_tgsi_to_nir(compiler, cso->tokens, screen);
+               nir = tgsi_to_nir(cso->tokens, screen);
        }
 
        struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir);
@@ -170,7 +170,7 @@ ir3_shader_create_compute(struct ir3_compiler *compiler,
                if (ir3_shader_debug & IR3_DBG_DISASM) {
                        tgsi_dump(cso->prog, 0);
                }
-               nir = ir3_tgsi_to_nir(compiler, cso->prog, screen);
+               nir = tgsi_to_nir(cso->prog, screen);
        }
 
        struct ir3_shader *shader = ir3_shader_from_nir(compiler, nir);
@@ -178,20 +178,6 @@ ir3_shader_create_compute(struct ir3_compiler *compiler,
        return shader;
 }
 
-struct nir_shader *
-ir3_tgsi_to_nir(struct ir3_compiler *compiler,
-               const struct tgsi_token *tokens,
-               struct pipe_screen *screen)
-{
-       if (!screen) {
-               const nir_shader_compiler_options *options =
-                       ir3_get_compiler_options(compiler);
-               return tgsi_to_nir_noscreen(tokens, options);
-       }
-
-       return tgsi_to_nir(tokens, screen);
-}
-
 /* This has to reach into the fd_context a bit more than the rest of
  * ir3, but it needs to be aligned with the compiler, so both agree
  * on which const regs hold what.  And the logic is identical between
index 74f03e651ff25d6cd4b8ec05808faec22c2955bf..902a5c3a18ca7d137ef139d76f51bc5b3a6cc541 100644 (file)
@@ -43,9 +43,6 @@ ir3_shader_create_compute(struct ir3_compiler *compiler,
 struct ir3_shader_variant * ir3_shader_variant(struct ir3_shader *shader,
                struct ir3_shader_key key, bool binning_pass,
                struct pipe_debug_callback *debug);
-struct nir_shader * ir3_tgsi_to_nir(struct ir3_compiler *compiler,
-               const struct tgsi_token *tokens,
-               struct pipe_screen *screen);
 
 struct fd_ringbuffer;
 struct fd_context;