Commit 6d9b4517 authored by Eric Anholt's avatar Eric Anholt

freedreno: Remove the ir3_tgsi_to_nir() helper function.

It was more of a hindrance, as it pretended that we could compile in the
driver with a missing screen.
Reviewed-by: Rob Clark's avatarRob Clark <robdclark@gmail.com>
Tested-by: Eduardo Lima Mitev's avatarEduardo Lima Mitev <elima@igalia.com>
parent a0d4d7fe
......@@ -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);
......
......@@ -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
......
......@@ -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;
......
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