values[chan] = ctx->abi->inputs[idx + chan + const_index * stride];
}
break;
- case nir_var_local:
+ case nir_var_function:
for (unsigned chan = 0; chan < ve; chan++) {
if (indir_index) {
unsigned count = glsl_count_attribute_slots(
}
}
break;
- case nir_var_local:
+ case nir_var_function:
for (unsigned chan = 0; chan < 8; chan++) {
if (!(writemask & (1 << chan)))
continue;
* See the following thread for more details of the problem:
* https://lists.freedesktop.org/archives/mesa-dev/2017-July/162106.html
*/
- indirect_mask |= nir_var_local;
+ indirect_mask |= nir_var_function;
nir_lower_indirect_derefs(nir, indirect_mask);
}
do {
progress = false;
- NIR_PASS(progress, shader, nir_split_array_vars, nir_var_local);
- NIR_PASS(progress, shader, nir_shrink_vec_array_vars, nir_var_local);
+ NIR_PASS(progress, shader, nir_split_array_vars, nir_var_function);
+ NIR_PASS(progress, shader, nir_shrink_vec_array_vars, nir_var_function);
NIR_PASS_V(shader, nir_lower_vars_to_ssa);
NIR_PASS_V(shader, nir_lower_pack);
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
*/
- NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_local);
+ NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_function);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_opt_deref);
nir_split_var_copies(nir);
nir_lower_global_vars_to_local(nir);
- nir_remove_dead_variables(nir, nir_var_local);
+ nir_remove_dead_variables(nir, nir_var_function);
nir_lower_subgroups(nir, &(struct nir_lower_subgroups_options) {
.subgroup_size = 64,
.ballot_bit_size = 64,
case ir_var_auto:
case ir_var_temporary:
if (is_global)
- var->data.mode = nir_var_global;
+ var->data.mode = nir_var_private;
else
- var->data.mode = nir_var_local;
+ var->data.mode = nir_var_function;
break;
case ir_var_function_in:
case ir_var_function_out:
case ir_var_function_inout:
case ir_var_const_in:
- var->data.mode = nir_var_local;
+ var->data.mode = nir_var_function;
break;
case ir_var_shader_in:
var->interface_type = ir->get_interface_type();
- if (var->data.mode == nir_var_local)
+ if (var->data.mode == nir_var_function)
nir_function_impl_add_variable(impl, var);
else
nir_shader_add_variable(shader, var);
* sense, we'll just turn it into a load which will probably
* eventually end up as an SSA definition.
*/
- assert(this->deref->mode == nir_var_global);
+ assert(this->deref->mode == nir_var_private);
op = nir_intrinsic_load_deref;
}
assert(!"invalid mode");
break;
- case nir_var_local:
+ case nir_var_function:
assert(!"nir_shader_add_variable cannot be used for local variables");
break;
- case nir_var_global:
+ case nir_var_private:
exec_list_push_tail(&shader->globals, &var->node);
break;
nir_variable *var = rzalloc(impl->function->shader, nir_variable);
var->name = ralloc_strdup(var, name);
var->type = type;
- var->data.mode = nir_var_local;
+ var->data.mode = nir_var_function;
nir_function_impl_add_variable(impl, var);
typedef enum {
nir_var_shader_in = (1 << 0),
nir_var_shader_out = (1 << 1),
- nir_var_global = (1 << 2),
- nir_var_local = (1 << 3),
+ nir_var_private = (1 << 2),
+ nir_var_function = (1 << 3),
nir_var_uniform = (1 << 4),
nir_var_ubo = (1 << 5),
nir_var_system_value = (1 << 6),
static inline bool
nir_variable_is_global(const nir_variable *var)
{
- return var->data.mode != nir_var_local;
+ return var->data.mode != nir_var_function;
}
typedef struct nir_register {
static inline void
nir_function_impl_add_variable(nir_function_impl *impl, nir_variable *var)
{
- assert(var->data.mode == nir_var_local);
+ assert(var->data.mode == nir_var_function);
exec_list_push_tail(&impl->locals, &var->node);
}
* For most use-cases, function inlining is a multi-step process. The general
* pattern employed by SPIR-V consumers and others is as follows:
*
- * 1. nir_lower_constant_initializers(shader, nir_var_local)
+ * 1. nir_lower_constant_initializers(shader, nir_var_function)
*
* This is needed because local variables from the callee are simply added
* to the locals list for the caller and the information about where the
* spirv_to_nir returns the root function and so we can just use == whereas
* with GL, you may have to look for a function named "main".
*
- * 6. nir_lower_constant_initializers(shader, ~nir_var_local)
+ * 6. nir_lower_constant_initializers(shader, ~nir_var_function)
*
* Lowering constant initializers on inputs, outputs, global variables,
* etc. requires that we know the main entrypoint so that we know where to
if (!(other_stage & get_variable_io_mask(var, shader->info.stage))) {
/* This one is invalid, make it a global variable instead */
var->data.location = 0;
- var->data.mode = nir_var_global;
+ var->data.mode = nir_var_private;
exec_node_remove(&var->node);
exec_list_push_tail(&shader->globals, &var->node);
if (clipvertex) {
exec_node_remove(&clipvertex->node);
- clipvertex->data.mode = nir_var_global;
+ clipvertex->data.mode = nir_var_private;
exec_list_push_tail(&shader->globals, &clipvertex->node);
}
} else {
bool progress = false;
nir_builder builder;
- if (modes & ~nir_var_local)
+ if (modes & ~nir_var_function)
nir_builder_init(&builder, nir_shader_get_entrypoint(shader));
if (modes & nir_var_shader_out)
progress |= lower_const_initializer(&builder, &shader->outputs);
- if (modes & nir_var_global)
+ if (modes & nir_var_private)
progress |= lower_const_initializer(&builder, &shader->globals);
if (modes & nir_var_system_value)
}
}
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
nir_foreach_function(function, shader) {
if (!function->impl)
continue;
register_var_use(nir_variable *var, nir_function_impl *impl,
struct hash_table *var_func_table)
{
- if (var->data.mode != nir_var_global)
+ if (var->data.mode != nir_var_private)
return;
struct hash_entry *entry =
nir_variable *var = (void *)entry->key;
nir_function_impl *impl = entry->data;
- assert(var->data.mode == nir_var_global);
+ assert(var->data.mode == nir_var_private);
if (impl != NULL) {
exec_node_remove(&var->node);
- var->data.mode = nir_var_local;
+ var->data.mode = nir_var_function;
exec_list_push_tail(&impl->locals, &var->node);
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance |
/* Give the original a new name with @<mode>-temp appended */
const char *mode = (temp->data.mode == nir_var_shader_in) ? "in" : "out";
temp->name = ralloc_asprintf(var, "%s@%s-temp", mode, nvar->name);
- temp->data.mode = nir_var_global;
+ temp->data.mode = nir_var_private;
temp->data.read_only = false;
temp->data.fb_fetch_output = false;
temp->data.compact = false;
switch (intrin->intrinsic) {
case nir_intrinsic_load_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
b->cursor = nir_before_instr(&intrin->instr);
case nir_intrinsic_store_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
b->cursor = nir_before_instr(&intrin->instr);
/* This pass only works on local variables. Just ignore any derefs with
* a non-local mode.
*/
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
return NULL;
struct deref_node *node = get_deref_node_recur(deref, state);
switch (intrin->intrinsic) {
case nir_intrinsic_load_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
struct deref_node *node = get_deref_node(deref, state);
case nir_intrinsic_store_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
struct deref_node *node = get_deref_node(deref, state);
assert(path->path[0]->deref_type == nir_deref_type_var);
/* We don't build deref nodes for non-local variables */
- assert(path->path[0]->var->data.mode == nir_var_local);
+ assert(path->path[0]->var->data.mode == nir_var_function);
if (path_may_be_aliased(path, &state)) {
exec_node_remove(&node->direct_derefs_link);
nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_call) {
written->modes |= nir_var_shader_out |
- nir_var_global |
- nir_var_local |
+ nir_var_private |
+ nir_var_function |
nir_var_ssbo |
nir_var_shared;
continue;
nir_foreach_instr_safe(instr, block) {
if (instr->type == nir_instr_type_call) {
apply_barrier_for_modes(copies, nir_var_shader_out |
- nir_var_global |
- nir_var_local |
+ nir_var_private |
+ nir_var_function |
nir_var_ssbo |
nir_var_shared);
continue;
nir_foreach_instr_safe(instr, block) {
if (instr->type == nir_instr_type_call) {
clear_unused_for_modes(&unused_writes, nir_var_shader_out |
- nir_var_global |
- nir_var_local |
+ nir_var_private |
+ nir_var_function |
nir_var_ssbo |
nir_var_shared);
continue;
* continue on because it won't affect local stores or read-only
* variables.
*/
- if (dst_deref->mode != nir_var_local)
+ if (dst_deref->mode != nir_var_function)
continue;
/* We keep track of the SSA indices where the two last-written
*/
const nir_variable_mode read_only_modes =
nir_var_shader_in | nir_var_uniform | nir_var_system_value;
- if (!(src_deref->mode & (nir_var_local | read_only_modes)))
+ if (!(src_deref->mode & (nir_var_function | read_only_modes)))
goto reset;
/* If we don't yet have an active copy, then make this instruction the
continue;
}
- if (dst_deref && dst_deref->mode == nir_var_local) {
+ if (dst_deref && dst_deref->mode == nir_var_function) {
nir_variable *var = nir_deref_instr_get_variable(dst_deref);
- assert(var->data.mode == nir_var_local);
+ assert(var->data.mode == nir_var_function);
/* We only consider variables constant if they only have constant
* stores, all the stores come before any reads, and all stores
info->is_constant = false;
}
- if (src_deref && src_deref->mode == nir_var_local) {
+ if (src_deref && src_deref->mode == nir_var_function) {
nir_variable *var = nir_deref_instr_get_variable(src_deref);
- assert(var->data.mode == nir_var_local);
+ assert(var->data.mode == nir_var_function);
var_infos[var->data.index].found_read = true;
}
switch (intrin->intrinsic) {
case nir_intrinsic_load_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
case nir_intrinsic_store_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
case nir_intrinsic_copy_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[1]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
return "ssbo";
case nir_var_shared:
return "shared";
- case nir_var_global:
- return want_local_global_mode ? "global" : "";
- case nir_var_local:
- return want_local_global_mode ? "local" : "";
+ case nir_var_private:
+ return want_local_global_mode ? "private" : "";
+ case nir_var_function:
+ return want_local_global_mode ? "function" : "";
default:
return "";
}
* all means we need to keep it alive.
*/
assert(deref->mode == deref->var->data.mode);
- if (!(deref->mode & (nir_var_local | nir_var_global | nir_var_shared)) ||
+ if (!(deref->mode & (nir_var_function | nir_var_private | nir_var_shared)) ||
deref_used_for_not_store(deref))
_mesa_set_add(live, deref->var);
}
if (modes & nir_var_shader_out)
progress = remove_dead_vars(&shader->outputs, live) || progress;
- if (modes & nir_var_global)
+ if (modes & nir_var_private)
progress = remove_dead_vars(&shader->globals, live) || progress;
if (modes & nir_var_system_value)
if (modes & nir_var_shared)
progress = remove_dead_vars(&shader->shared, live) || progress;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
nir_foreach_function(function, shader) {
if (function->impl) {
if (remove_dead_vars(&function->impl->locals, live))
var_type = wrap_type_in_array(var_type, f->type);
nir_variable_mode mode = state->base_var->data.mode;
- if (mode == nir_var_local) {
+ if (mode == nir_var_function) {
field->var = nir_local_variable_create(state->impl, var_type, name);
} else {
field->var = nir_variable_create(state->shader, mode, var_type, name);
_mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
_mesa_key_pointer_equal);
- assert((modes & (nir_var_global | nir_var_local)) == modes);
+ assert((modes & (nir_var_private | nir_var_function)) == modes);
bool has_global_splits = false;
- if (modes & nir_var_global) {
+ if (modes & nir_var_private) {
has_global_splits = split_var_list_structs(shader, NULL,
&shader->globals,
var_field_map, mem_ctx);
continue;
bool has_local_splits = false;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
has_local_splits = split_var_list_structs(shader, function->impl,
&function->impl->locals,
var_field_map, mem_ctx);
name = ralloc_asprintf(mem_ctx, "(%s)", name);
nir_variable_mode mode = var_info->base_var->data.mode;
- if (mode == nir_var_local) {
+ if (mode == nir_var_function) {
split->var = nir_local_variable_create(impl,
var_info->split_var_type, name);
} else {
_mesa_hash_table_create(mem_ctx, _mesa_hash_pointer,
_mesa_key_pointer_equal);
- assert((modes & (nir_var_global | nir_var_local)) == modes);
+ assert((modes & (nir_var_private | nir_var_function)) == modes);
bool has_global_array = false;
- if (modes & nir_var_global) {
+ if (modes & nir_var_private) {
has_global_array = init_var_list_array_infos(&shader->globals,
var_info_map, mem_ctx);
}
continue;
bool has_local_array = false;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
has_local_array = init_var_list_array_infos(&function->impl->locals,
var_info_map, mem_ctx);
}
}
bool has_global_splits = false;
- if (modes & nir_var_global) {
+ if (modes & nir_var_private) {
has_global_splits = split_var_list_arrays(shader, NULL,
&shader->globals,
var_info_map, mem_ctx);
continue;
bool has_local_splits = false;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
has_local_splits = split_var_list_arrays(shader, function->impl,
&function->impl->locals,
var_info_map, mem_ctx);
{
nir_shader *shader = impl->function->shader;
- if ((modes & nir_var_global) && !exec_list_is_empty(&shader->globals))
+ if ((modes & nir_var_private) && !exec_list_is_empty(&shader->globals))
return true;
- if ((modes & nir_var_local) && !exec_list_is_empty(&impl->locals))
+ if ((modes & nir_var_function) && !exec_list_is_empty(&impl->locals))
return true;
return false;
bool
nir_shrink_vec_array_vars(nir_shader *shader, nir_variable_mode modes)
{
- assert((modes & (nir_var_global | nir_var_local)) == modes);
+ assert((modes & (nir_var_private | nir_var_function)) == modes);
void *mem_ctx = ralloc_context(NULL);
}
bool globals_shrunk = false;
- if (modes & nir_var_global)
+ if (modes & nir_var_private)
globals_shrunk = shrink_vec_var_list(&shader->globals, var_usage_map);
bool progress = false;
continue;
bool locals_shrunk = false;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
locals_shrunk = shrink_vec_var_list(&function->impl->locals,
var_usage_map);
}
{
struct hash_entry *entry = _mesa_hash_table_search(state->var_defs, var);
validate_assert(state, entry);
- if (var->data.mode == nir_var_local)
+ if (var->data.mode == nir_var_function)
validate_assert(state, (nir_function_impl *) entry->data == state->impl);
}
~nir_vars_test();
nir_variable *create_int(nir_variable_mode mode, const char *name) {
- if (mode == nir_var_local)
+ if (mode == nir_var_function)
return nir_local_variable_create(b->impl, glsl_int_type(), name);
return nir_variable_create(b->shader, mode, glsl_int_type(), name);
}
nir_variable *create_ivec2(nir_variable_mode mode, const char *name) {
const glsl_type *var_type = glsl_vector_type(GLSL_TYPE_INT, 2);
- if (mode == nir_var_local)
+ if (mode == nir_var_function)
return nir_local_variable_create(b->impl, var_type, name);
return nir_variable_create(b->shader, mode, var_type, name);
}
* if statement. They should be invalidated accordingly.
*/
- nir_variable **g = create_many_int(nir_var_global, "g", 3);
+ nir_variable **g = create_many_int(nir_var_private, "g", 3);
nir_variable **out = create_many_int(nir_var_shader_out, "out", 3);
nir_load_var(b, g[0]);
TEST_F(nir_copy_prop_vars_test, simple_copies)
{
nir_variable *in = create_int(nir_var_shader_in, "in");
- nir_variable *temp = create_int(nir_var_local, "temp");
+ nir_variable *temp = create_int(nir_var_function, "temp");
nir_variable *out = create_int(nir_var_shader_out, "out");
nir_copy_var(b, temp, in);
TEST_F(nir_copy_prop_vars_test, simple_store_load)
{
- nir_variable **v = create_many_ivec2(nir_var_local, "v", 2);
+ nir_variable **v = create_many_ivec2(nir_var_function, "v", 2);
unsigned mask = 1 | 2;
nir_ssa_def *stored_value = nir_imm_ivec2(b, 10, 20);
TEST_F(nir_copy_prop_vars_test, store_store_load)
{
- nir_variable **v = create_many_ivec2(nir_var_local, "v", 2);
+ nir_variable **v = create_many_ivec2(nir_var_function, "v", 2);
unsigned mask = 1 | 2;
nir_ssa_def *first_value = nir_imm_ivec2(b, 10, 20);
TEST_F(nir_copy_prop_vars_test, store_store_load_different_components)
{
- nir_variable **v = create_many_ivec2(nir_var_local, "v", 2);
+ nir_variable **v = create_many_ivec2(nir_var_function, "v", 2);
nir_ssa_def *first_value = nir_imm_ivec2(b, 10, 20);
nir_store_var(b, v[0], first_value, 1 << 1);
TEST_F(nir_copy_prop_vars_test, store_store_load_different_components_in_many_blocks)
{
- nir_variable **v = create_many_ivec2(nir_var_local, "v", 2);
+ nir_variable **v = create_many_ivec2(nir_var_function, "v", 2);
nir_ssa_def *first_value = nir_imm_ivec2(b, 10, 20);
nir_store_var(b, v[0], first_value, 1 << 1);
TEST_F(nir_copy_prop_vars_test, simple_store_load_in_two_blocks)
{
- nir_variable **v = create_many_ivec2(nir_var_local, "v", 2);
+ nir_variable **v = create_many_ivec2(nir_var_function, "v", 2);
unsigned mask = 1 | 2;
nir_ssa_def *stored_value = nir_imm_ivec2(b, 10, 20);
glsl_get_bare_type(b->func->type->return_type->type);
nir_deref_instr *ret_deref =
nir_build_deref_cast(&b->nb, nir_load_param(&b->nb, 0),
- nir_var_local, ret_type, 0);
+ nir_var_function, ret_type, 0);
vtn_local_store(b, src, ret_deref);
}
};
enum vtn_variable_mode {
- vtn_variable_mode_local,
- vtn_variable_mode_global,
+ vtn_variable_mode_function,
+ vtn_variable_mode_private,
vtn_variable_mode_uniform,
vtn_variable_mode_ubo,
vtn_variable_mode_ssbo,
nir_mode = nir_var_shader_out;
break;
case SpvStorageClassPrivate:
- mode = vtn_variable_mode_global;
- nir_mode = nir_var_global;
+ mode = vtn_variable_mode_private;
+ nir_mode = nir_var_private;
break;
case SpvStorageClassFunction:
- mode = vtn_variable_mode_local;
- nir_mode = nir_var_local;
+ mode = vtn_variable_mode_function;
+ nir_mode = nir_var_function;
break;
case SpvStorageClassWorkgroup:
mode = vtn_variable_mode_workgroup;
val->pointer = vtn_pointer_for_variable(b, var, ptr_type);
switch (var->mode) {
- case vtn_variable_mode_local:
- case vtn_variable_mode_global:
+ case vtn_variable_mode_function:
+ case vtn_variable_mode_private:
case vtn_variable_mode_uniform:
/* For these, we create the variable normally */
var->var = rzalloc(b->shader, nir_variable);
var->var->data.image.format = without_array->image_format;
}
- if (var->mode == vtn_variable_mode_local) {
+ if (var->mode == vtn_variable_mode_function) {
vtn_assert(var->var != NULL && var->var->members == NULL);
nir_function_impl_add_variable(b->nb.impl, var->var);
} else if (var->var) {
if (OPT(s, nir_lower_idiv))
ir3_optimize_loop(s);
- OPT_V(s, nir_remove_dead_variables, nir_var_local);
+ OPT_V(s, nir_remove_dead_variables, nir_var_function);
OPT_V(s, nir_move_load_const);
nir_variable *var = rzalloc(b->shader, nir_variable);
var->type = glsl_array_type(glsl_vec4_type(), array_size, 0);
- var->data.mode = nir_var_global;
+ var->data.mode = nir_var_private;
var->name = ralloc_asprintf(var, "arr_%d", decl->Array.ArrayID);
exec_list_push_tail(&b->shader->globals, &var->node);
v3d_optimize_nir(s);
- NIR_PASS_V(s, nir_remove_dead_variables, nir_var_local);
+ NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function);
/* Garbage collect dead instructions */
nir_sweep(s);
NIR_PASS(progress, s, nir_opt_loop_unroll,
nir_var_shader_in |
nir_var_shader_out |
- nir_var_local);
+ nir_var_function);
} while (progress);
}
vc4_optimize_nir(s);
- NIR_PASS_V(s, nir_remove_dead_variables, nir_var_local);
+ NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function);
/* Garbage collect dead instructions */
nir_sweep(s);
if (compiler->glsl_compiler_options[stage].EmitNoIndirectOutput)
indirect_mask |= nir_var_shader_out;
if (compiler->glsl_compiler_options[stage].EmitNoIndirectTemp)
- indirect_mask |= nir_var_local;
+ indirect_mask |= nir_var_function;
return indirect_mask;
}
bool progress;
do {
progress = false;
- OPT(nir_split_array_vars, nir_var_local);
- OPT(nir_shrink_vec_array_vars, nir_var_local);
+ OPT(nir_split_array_vars, nir_var_function);
+ OPT(nir_shrink_vec_array_vars, nir_var_function);
OPT(nir_lower_vars_to_ssa);
if (allow_copies) {
/* Only run this pass in the first call to brw_nir_optimize. Later
/* Workaround Gfxbench unused local sampler variable which will trigger an
* assert in the opt_large_constants pass.
*/
- OPT(nir_remove_dead_variables, nir_var_local);
+ OPT(nir_remove_dead_variables, nir_var_function);
return nir;
}
OPT(nir_lower_global_vars_to_local);
OPT(nir_split_var_copies);
- OPT(nir_split_struct_vars, nir_var_local);
+ OPT(nir_split_struct_vars, nir_var_function);
/* Run opt_algebraic before int64 lowering so we can hopefully get rid
* of some int64 instructions.
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
*/
- NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_local);
+ NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_function);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_opt_deref);
!(stage->key.wm.color_outputs_valid & (1 << rt))) {
/* Unused or out-of-bounds, throw it away */
deleted_output = true;
- var->data.mode = nir_var_local;
+ var->data.mode = nir_var_function;
exec_node_remove(&var->node);
exec_list_push_tail(&impl->locals, &var->node);
continue;
* inline functions. That way they get properly initialized at the top
* of the function and not at the top of its caller.
*/
- NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_local);
+ NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_function);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions);
NIR_PASS_V(nir, nir_opt_deref);
* set.
*/
exec_node_remove(&var->node);
- var->data.mode = nir_var_global;
+ var->data.mode = nir_var_private;
exec_list_push_tail(&nir->globals, &var->node);
}
}
* See the following thread for more details of the problem:
* https://lists.freedesktop.org/archives/mesa-dev/2017-July/162106.html
*/
- nir_variable_mode indirect_mask = nir_var_local;
+ nir_variable_mode indirect_mask = nir_var_function;
NIR_PASS_V(*producer, nir_lower_indirect_derefs, indirect_mask);
NIR_PASS_V(*consumer, nir_lower_indirect_derefs, indirect_mask);