#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"
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) {
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);
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);
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);
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
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;