case ir_var_auto:
case ir_var_temporary:
if (is_global)
- var->data.mode = nir_var_private;
+ var->data.mode = nir_var_shader_temp;
else
var->data.mode = nir_var_function;
break;
* 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_private);
+ assert(this->deref->mode == nir_var_shader_temp);
op = nir_intrinsic_load_deref;
}
assert(!"nir_shader_add_variable cannot be used for local variables");
break;
- case nir_var_private:
+ case nir_var_shader_temp:
exec_list_push_tail(&shader->globals, &var->node);
break;
typedef enum {
nir_var_shader_in = (1 << 0),
nir_var_shader_out = (1 << 1),
- nir_var_private = (1 << 2),
+ nir_var_shader_temp = (1 << 2),
nir_var_function = (1 << 3),
nir_var_uniform = (1 << 4),
nir_var_ubo = (1 << 5),
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_private;
+ var->data.mode = nir_var_shader_temp;
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_private;
+ clipvertex->data.mode = nir_var_shader_temp;
exec_list_push_tail(&shader->globals, &clipvertex->node);
}
} else {
if ((modes & nir_var_shader_out) && function->is_entrypoint)
impl_progress |= lower_const_initializer(&builder, &shader->outputs);
- if ((modes & nir_var_private) && function->is_entrypoint)
+ if ((modes & nir_var_shader_temp) && function->is_entrypoint)
impl_progress |= lower_const_initializer(&builder, &shader->globals);
if ((modes & nir_var_system_value) && function->is_entrypoint)
register_var_use(nir_variable *var, nir_function_impl *impl,
struct hash_table *var_func_table)
{
- if (var->data.mode != nir_var_private)
+ if (var->data.mode != nir_var_shader_temp)
return;
struct hash_entry *entry =
nir_variable *var = (void *)entry->key;
nir_function_impl *impl = entry->data;
- assert(var->data.mode == nir_var_private);
+ assert(var->data.mode == nir_var_shader_temp);
if (impl != NULL) {
exec_node_remove(&var->node);
/* 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_private;
+ temp->data.mode = nir_var_shader_temp;
temp->data.read_only = false;
temp->data.fb_fetch_output = false;
temp->data.compact = false;
nir_foreach_instr(instr, block) {
if (instr->type == nir_instr_type_call) {
written->modes |= nir_var_shader_out |
- nir_var_private |
+ nir_var_shader_temp |
nir_var_function |
nir_var_ssbo |
nir_var_shared;
nir_foreach_instr_safe(instr, block) {
if (instr->type == nir_instr_type_call) {
apply_barrier_for_modes(copies, nir_var_shader_out |
- nir_var_private |
+ nir_var_shader_temp |
nir_var_function |
nir_var_ssbo |
nir_var_shared);
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_private |
+ nir_var_shader_temp |
nir_var_function |
nir_var_ssbo |
nir_var_shared);
return "ssbo";
case nir_var_shared:
return "shared";
- case nir_var_private:
- return want_local_global_mode ? "private" : "";
+ case nir_var_shader_temp:
+ return want_local_global_mode ? "shader_temp" : "";
case nir_var_function:
return want_local_global_mode ? "function" : "";
default:
* all means we need to keep it alive.
*/
assert(deref->mode == deref->var->data.mode);
- if (!(deref->mode & (nir_var_function | nir_var_private | nir_var_shared)) ||
+ if (!(deref->mode & (nir_var_function | nir_var_shader_temp | 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_private)
+ if (modes & nir_var_shader_temp)
progress = remove_dead_vars(&shader->globals, live) || progress;
if (modes & nir_var_system_value)
struct hash_table *var_field_map =
_mesa_pointer_hash_table_create(mem_ctx);
- assert((modes & (nir_var_private | nir_var_function)) == modes);
+ assert((modes & (nir_var_shader_temp | nir_var_function)) == modes);
bool has_global_splits = false;
- if (modes & nir_var_private) {
+ if (modes & nir_var_shader_temp) {
has_global_splits = split_var_list_structs(shader, NULL,
&shader->globals,
var_field_map, mem_ctx);
void *mem_ctx = ralloc_context(NULL);
struct hash_table *var_info_map = _mesa_pointer_hash_table_create(mem_ctx);
- assert((modes & (nir_var_private | nir_var_function)) == modes);
+ assert((modes & (nir_var_shader_temp | nir_var_function)) == modes);
bool has_global_array = false;
- if (modes & nir_var_private) {
+ if (modes & nir_var_shader_temp) {
has_global_array = init_var_list_array_infos(&shader->globals,
var_info_map, mem_ctx);
}
}
bool has_global_splits = false;
- if (modes & nir_var_private) {
+ if (modes & nir_var_shader_temp) {
has_global_splits = split_var_list_arrays(shader, NULL,
&shader->globals,
var_info_map, mem_ctx);
{
nir_shader *shader = impl->function->shader;
- if ((modes & nir_var_private) && !exec_list_is_empty(&shader->globals))
+ if ((modes & nir_var_shader_temp) && !exec_list_is_empty(&shader->globals))
return true;
if ((modes & nir_var_function) && !exec_list_is_empty(&impl->locals))
bool
nir_shrink_vec_array_vars(nir_shader *shader, nir_variable_mode modes)
{
- assert((modes & (nir_var_private | nir_var_function)) == modes);
+ assert((modes & (nir_var_shader_temp | nir_var_function)) == modes);
void *mem_ctx = ralloc_context(NULL);
}
bool globals_shrunk = false;
- if (modes & nir_var_private)
+ if (modes & nir_var_shader_temp)
globals_shrunk = shrink_vec_var_list(&shader->globals, var_usage_map);
bool progress = false;
* if statement. They should be invalidated accordingly.
*/
- nir_variable **g = create_many_int(nir_var_private, "g", 3);
+ nir_variable **g = create_many_int(nir_var_shader_temp, "g", 3);
nir_variable **out = create_many_int(nir_var_shader_out, "out", 3);
nir_load_var(b, g[0]);
break;
case SpvStorageClassPrivate:
mode = vtn_variable_mode_private;
- nir_mode = nir_var_private;
+ nir_mode = nir_var_shader_temp;
break;
case SpvStorageClassFunction:
mode = vtn_variable_mode_function;
nir_variable *var = rzalloc(b->shader, nir_variable);
var->type = glsl_array_type(glsl_vec4_type(), array_size, 0);
- var->data.mode = nir_var_private;
+ var->data.mode = nir_var_shader_temp;
var->name = ralloc_asprintf(var, "arr_%d", decl->Array.ArrayID);
exec_list_push_tail(&b->shader->globals, &var->node);
* set.
*/
exec_node_remove(&var->node);
- var->data.mode = nir_var_private;
+ var->data.mode = nir_var_shader_temp;
exec_list_push_tail(&nir->globals, &var->node);
}
}