summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-19 10:50:40 -0700
committerJason Ekstrand <[email protected]>2018-06-22 20:15:54 -0700
commit74212c2414ce04c1331f6c79d74bcc75ea5d4726 (patch)
tree84b4493870a2f29c4011b16ae62d9eca2204180b /src/gallium/drivers/freedreno
parent8b7aa66169f9d675f83c483b3c7af38007e7e056 (diff)
anv,i965,radv,st,ir3: Call nir_lower_deref_instrs
This inserts a call to nir_lower_deref_instrs at every call site of glsl_to_nir, spirv_to_nir, and prog_to_nir. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Acked-by: Rob Clark <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_cmdline.c3
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_nir.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
index 55809d527ad..ab2fbf618bf 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cmdline.c
@@ -113,6 +113,7 @@ load_glsl(unsigned num_files, char* const* files, gl_shader_stage stage)
errx(1, "couldn't parse `%s'", files[0]);
nir_shader *nir = glsl_to_nir(prog, stage, ir3_get_compiler_options(compiler));
+ nir_lower_deref_instrs(nir, ~0);
/* required NIR passes: */
/* TODO cmdline args for some of the conditional lowering passes? */
@@ -232,6 +233,8 @@ load_spirv(const char *filename, const char *entry, gl_shader_stage stage)
&spirv_options,
ir3_get_compiler_options(compiler));
+ NIR_PASS_V(entry_point->shader, nir_lower_deref_instrs, ~0);
+
nir_print_shader(entry_point->shader, stdout);
return entry_point->shader;
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
index 9ada3889eb9..990be925833 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c
@@ -57,7 +57,9 @@ static const nir_shader_compiler_options options = {
struct nir_shader *
ir3_tgsi_to_nir(const struct tgsi_token *tokens)
{
- return tgsi_to_nir(tokens, &options);
+ struct nir_shader *shader = tgsi_to_nir(tokens, &options);
+ NIR_PASS_V(shader, nir_lower_deref_instrs, ~0);
+ return shader;
}
const nir_shader_compiler_options *