Lines Matching refs:var
48 /* We only need to consider var derefs because
53 _mesa_set_add(complex_vars, deref->var);
78 nir_variable *var;
135 field->var = nir_local_variable_create(state->impl, var_type, name);
137 field->var = nir_variable_create(state->shader, mode, var_type, name);
139 field->var->data.ray_query = state->base_var->data.ray_query;
164 nir_foreach_variable_in_list_safe(var, vars) {
165 if (var->data.mode != mode)
168 if (!glsl_type_is_struct_or_ifc(glsl_without_array(var->type)))
177 if (_mesa_set_search(*complex_vars, var))
180 exec_node_remove(&var->node);
181 exec_list_push_tail(&split_vars, &var->node);
184 nir_foreach_variable_in_list(var, &split_vars) {
185 state.base_var = var;
188 init_field_for_type(root_field, NULL, var->type, var->name, &state);
189 _mesa_hash_table_insert(var_field_map, var, root_field);
253 nir_variable *split_var = tail_field->var;
353 nir_variable *var;
381 nir_foreach_variable_in_list(var, vars) {
382 if (var->data.mode != mode)
385 int num_levels = num_array_levels_in_array_of_vector_type(var->type);
395 if (_mesa_set_search(*complex_vars, var))
402 info->base_var = var;
405 const struct glsl_type *type = var->type;
414 _mesa_hash_table_insert(var_info_map, var, info);
422 get_array_var_info(nir_variable *var,
426 _mesa_hash_table_search(var_info_map, var);
438 nir_variable *var = nir_deref_instr_get_variable(deref);
439 if (var == NULL)
442 return get_array_var_info(var, var_info_map);
523 split->var = nir_local_variable_create(impl,
526 split->var = nir_variable_create(shader, mode,
529 split->var->data.ray_query = var_info->base_var->data.ray_query;
554 nir_foreach_variable_in_list_safe(var, vars) {
555 if (var->data.mode != mode)
558 struct array_var_info *info = get_array_var_info(var, var_info_map);
564 glsl_without_array_or_matrix(var->type);
575 glsl_type_is_matrix(glsl_without_array(var->type))) {
590 exec_node_remove(&var->node);
591 exec_list_push_tail(&split_vars, &var->node);
593 assert(split_type == glsl_get_bare_type(var->type));
597 _mesa_hash_table_remove_key(var_info_map, var);
601 nir_foreach_variable_in_list(var, &split_vars) {
602 struct array_var_info *info = get_array_var_info(var, var_info_map);
603 create_split_array_vars(info, 0, &info->root_split, var->name,
617 assert(path->path[0]->var == info->base_var);
634 assert(path->path[0]->var == info->base_var);
829 assert(!split->splits && split->var);
831 nir_deref_instr *new_deref = nir_build_deref_var(&b, split->var);
976 get_vec_var_usage(nir_variable *var,
980 struct hash_entry *entry = _mesa_hash_table_search(var_usage_map, var);
992 int num_levels = num_array_levels_in_array_of_vector_type(var->type);
1001 const struct glsl_type *type = var->type;
1010 _mesa_hash_table_insert(var_usage_map, var, usage);
1024 nir_variable *var = nir_deref_instr_get_variable(deref);
1025 if (var == NULL)
1038 /* Only bother with var derefs because nir_deref_instr_has_complex_use is
1044 if (!(deref->var->data.mode & modes))
1051 get_vec_var_usage(deref->var, var_usage_map, true, mem_ctx);
1070 nir_variable *var = nir_deref_instr_get_variable(deref);
1071 if (var == NULL)
1075 get_vec_var_usage(var, var_usage_map, true, mem_ctx);
1274 nir_foreach_variable_in_list(var, vars) {
1275 if (var->data.mode != mode)
1279 get_vec_var_usage(var, var_usage_map, false, NULL);
1310 nir_foreach_variable_in_list(var, vars) {
1311 if (var->data.mode != mode)
1315 get_vec_var_usage(var, var_usage_map, false, NULL);
1350 nir_foreach_variable_in_list_safe(var, vars) {
1351 if (var->data.mode != mode)
1355 get_vec_var_usage(var, var_usage_map, false, NULL);
1360 const struct glsl_type *vec_type = var->type;
1384 exec_node_remove(&var->node);
1392 _mesa_hash_table_remove_key(var_usage_map, var);
1396 /* Build the new var type */
1406 glsl_type_is_matrix(glsl_without_array(var->type)) &&
1415 var->type = new_type;
1490 deref->type = deref->var->type;
1623 nir_foreach_variable_with_modes(var, shader,