assert(exec_list_length(&nir->functions) == 1);
struct exec_node *node = exec_list_get_head(&nir->functions);
entry_point = exec_node_data(nir_function, node, node);
+
+ NIR_PASS_V(nir, nir_lower_deref_instrs, ~0);
} else {
uint32_t *spirv = (uint32_t *) module->data;
assert(module->size % 4 == 0);
free(spec_entries);
+ NIR_PASS_V(nir, nir_lower_deref_instrs, ~0);
+
/* We have to lower away local constant initializers right before we
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
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? */
&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;
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 *
fprintf(stderr, "\n");
}
s = tgsi_to_nir(cso->tokens, &v3d_nir_options);
+ NIR_PASS_V(s, nir_lower_deref_instrs, ~0);
so->was_tgsi = true;
}
fprintf(stderr, "\n");
}
s = tgsi_to_nir(cso->tokens, &nir_options);
+ NIR_PASS_V(s, nir_lower_deref_instrs, ~0);
}
NIR_PASS_V(s, nir_opt_global_to_local);
*/
wm_prog_data->base.binding_table.texture_start = BLORP_TEXTURE_BT_INDEX;
+ nir_lower_deref_instrs(nir, ~0);
nir = brw_preprocess_nir(compiler, nir);
nir_remove_dead_variables(nir, nir_var_shader_in);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
nir->options =
compiler->glsl_compiler_options[MESA_SHADER_VERTEX].NirOptions;
+ nir_lower_deref_instrs(nir, ~0);
nir = brw_preprocess_nir(compiler, nir);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
nir_print_shader(nir, stderr);
}
+ NIR_PASS_V(nir, nir_lower_deref_instrs, ~0);
+
/* We have to lower away local constant initializers right before we
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
/* First, lower the GLSL/Mesa IR or SPIR-V to NIR */
if (shader_prog) {
- if (shader_prog->data->spirv)
+ if (shader_prog->data->spirv) {
nir = _mesa_spirv_to_nir(ctx, shader_prog, stage, options);
- else
+ nir_lower_deref_instrs(nir, ~0);
+ } else {
nir = glsl_to_nir(shader_prog, stage, options);
+ nir_lower_deref_instrs(nir, ~0);
+ }
assert (nir);
nir_remove_dead_variables(nir, nir_var_shader_in | nir_var_shader_out);
nir_shader_get_entrypoint(nir), true, false);
} else {
nir = prog_to_nir(prog, options);
+ nir_lower_deref_instrs(nir, ~0);
NIR_PASS_V(nir, nir_lower_regs_to_ssa); /* turn registers into SSA */
}
nir_validate_shader(nir);
}
nir_validate_shader(nir);
+ nir_lower_deref_instrs(nir, ~0);
nir = brw_preprocess_nir(compiler, nir);
return prog->nir;
nir_shader *nir = glsl_to_nir(shader_program, stage, options);
+ nir_lower_deref_instrs(nir, (nir_lower_deref_flags)~0);
/* Set the next shader stage hint for VS and TES. */
if (!nir->info.separate_shader &&