Lines Matching refs:var

92       ir_variable *const var = ir->lhs->variable_referenced();  in visit_enter()  local
94 if (strcmp(name, var->name) == 0) { in visit_enter()
111 ir_variable *var = param_rval->variable_referenced(); in visit_enter() local
112 if (var && strcmp(name, var->name) == 0) { in visit_enter()
121 ir_variable *const var = ir->return_deref->variable_referenced(); in visit_enter() local
123 if (strcmp(name, var->name) == 0) { in visit_enter()
156 if (strcmp(this->name, ir->var->name) == 0) { in visit()
207 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in link_invalidate_variable_locations() local
209 if ((var == NULL) || (var->mode != (unsigned) mode)) in link_invalidate_variable_locations()
214 if ((var->location >= generic_base) && !var->explicit_location) in link_invalidate_variable_locations()
215 var->location = -1; in link_invalidate_variable_locations()
364 mode_string(const ir_variable *var) in mode_string() argument
366 switch (var->mode) { in mode_string()
368 return (var->read_only) ? "global constant" : "global variable"; in mode_string()
402 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in cross_validate_globals() local
404 if (var == NULL) in cross_validate_globals()
407 if (uniforms_only && (var->mode != ir_var_uniform)) in cross_validate_globals()
413 if (var->mode == ir_var_temporary) in cross_validate_globals()
420 ir_variable *const existing = variables.get_variable(var->name); in cross_validate_globals()
422 if (var->type != existing->type) { in cross_validate_globals()
428 if (var->type->is_array() in cross_validate_globals()
430 && (var->type->fields.array == existing->type->fields.array) in cross_validate_globals()
431 && ((var->type->length == 0) in cross_validate_globals()
433 if (var->type->length != 0) { in cross_validate_globals()
434 existing->type = var->type; in cross_validate_globals()
439 mode_string(var), in cross_validate_globals()
440 var->name, var->type->name, in cross_validate_globals()
446 if (var->explicit_location) { in cross_validate_globals()
448 && (var->location != existing->location)) { in cross_validate_globals()
451 mode_string(var), var->name); in cross_validate_globals()
455 existing->location = var->location; in cross_validate_globals()
470 if (strcmp(var->name, "gl_FragDepth") == 0) { in cross_validate_globals()
471 bool layout_declared = var->depth_layout != ir_depth_layout_none; in cross_validate_globals()
473 var->depth_layout != existing->depth_layout; in cross_validate_globals()
482 if (var->used && layout_differs) { in cross_validate_globals()
507 if (var->constant_initializer != NULL) { in cross_validate_globals()
509 if (!var->constant_initializer->has_value(existing->constant_initializer)) { in cross_validate_globals()
512 mode_string(var), var->name); in cross_validate_globals()
529 var->constant_initializer->clone(ralloc_parent(existing), in cross_validate_globals()
534 if (var->has_initializer) { in cross_validate_globals()
536 && (var->constant_initializer == NULL in cross_validate_globals()
541 var->name); in cross_validate_globals()
553 if (existing->invariant != var->invariant) { in cross_validate_globals()
556 mode_string(var), var->name); in cross_validate_globals()
559 if (existing->centroid != var->centroid) { in cross_validate_globals()
562 mode_string(var), var->name); in cross_validate_globals()
566 variables.add_variable(var); in cross_validate_globals()
642 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in cross_validate_outputs_to_inputs() local
647 if ((var == NULL) || (var->mode != ir_var_out)) in cross_validate_outputs_to_inputs()
650 parameters.add_variable(var); in cross_validate_outputs_to_inputs()
758 ir_variable *var; in populate_symbol_table() local
763 } else if ((var = inst->as_variable()) != NULL) { in populate_symbol_table()
764 sh->symbols->add_variable(var); in populate_symbol_table()
806 if (ir->var->mode == ir_var_temporary) { in remap_variables()
807 ir_variable *var = (ir_variable *) hash_table_find(temps, ir->var); in remap_variables() local
809 assert(var != NULL); in remap_variables()
810 ir->var = var; in remap_variables()
815 this->symbols->get_variable(ir->var->name); in remap_variables()
817 ir->var = existing; in remap_variables()
819 ir_variable *copy = ir->var->clone(this->target, NULL); in remap_variables()
823 ir->var = copy; in remap_variables()
879 ir_variable *var = inst->as_variable(); in move_non_declarations() local
880 if ((var != NULL) && (var->mode != ir_var_temporary)) in move_non_declarations()
886 || ((var != NULL) && (var->mode == ir_var_temporary))); in move_non_declarations()
891 if (var != NULL) in move_non_declarations()
892 hash_table_insert(temps, inst, var); in move_non_declarations()
943 virtual ir_visitor_status visit(ir_variable *var) in visit() argument
945 if (var->type->is_array() && (var->type->length == 0)) { in visit()
947 glsl_type::get_array_instance(var->type->fields.array, in visit()
948 var->max_array_access + 1); in visit()
950 var->type = type; in visit()
1163 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in update_array_sizes() local
1165 if ((var == NULL) || (var->mode != ir_var_uniform && in update_array_sizes()
1166 var->mode != ir_var_in && in update_array_sizes()
1167 var->mode != ir_var_out) || in update_array_sizes()
1168 !var->type->is_array()) in update_array_sizes()
1175 if (var->uniform_block != -1) in update_array_sizes()
1178 unsigned int size = var->max_array_access; in update_array_sizes()
1188 if (strcmp(var->name, other_var->name) == 0 && in update_array_sizes()
1195 if (size + 1 != var->type->fields.array->length) { in update_array_sizes()
1204 if (var->num_state_slots > 0) { in update_array_sizes()
1205 var->num_state_slots = (size + 1) in update_array_sizes()
1206 * (var->num_state_slots / var->type->length); in update_array_sizes()
1209 var->type = glsl_type::get_array_instance(var->type->fields.array, in update_array_sizes()
1312 ir_variable *var; in assign_attribute_or_color_locations() member
1328 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in assign_attribute_or_color_locations() local
1330 if ((var == NULL) || (var->mode != (unsigned) direction)) in assign_attribute_or_color_locations()
1333 if (var->explicit_location) { in assign_attribute_or_color_locations()
1334 if ((var->location >= (int)(max_index + generic_base)) in assign_attribute_or_color_locations()
1335 || (var->location < 0)) { in assign_attribute_or_color_locations()
1338 (var->location < 0) in assign_attribute_or_color_locations()
1339 ? var->location : var->location - generic_base, in assign_attribute_or_color_locations()
1340 var->name); in assign_attribute_or_color_locations()
1346 if (prog->AttributeBindings->get(binding, var->name)) { in assign_attribute_or_color_locations()
1348 var->location = binding; in assign_attribute_or_color_locations()
1354 if (prog->FragDataBindings->get(binding, var->name)) { in assign_attribute_or_color_locations()
1356 var->location = binding; in assign_attribute_or_color_locations()
1358 if (prog->FragDataIndexBindings->get(index, var->name)) { in assign_attribute_or_color_locations()
1359 var->index = index; in assign_attribute_or_color_locations()
1369 const unsigned slots = count_attribute_slots(var->type); in assign_attribute_or_color_locations()
1370 if (var->location != -1) { in assign_attribute_or_color_locations()
1371 if (var->location >= generic_base && var->index < 1) { in assign_attribute_or_color_locations()
1405 const unsigned attr = var->location - generic_base; in assign_attribute_or_color_locations()
1417 var->name, used_locations, use_mask, attr); in assign_attribute_or_color_locations()
1428 to_assign[num_attr].var = var; in assign_attribute_or_color_locations()
1467 string, to_assign[i].var->name); in assign_attribute_or_color_locations()
1471 to_assign[i].var->location = generic_base + location; in assign_attribute_or_color_locations()
1486 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in demote_shader_inputs_and_outputs() local
1488 if ((var == NULL) || (var->mode != int(mode))) in demote_shader_inputs_and_outputs()
1495 if (var->location == -1) { in demote_shader_inputs_and_outputs()
1496 var->mode = ir_var_auto; in demote_shader_inputs_and_outputs()
1540 bool matches_var(ir_variable *var) const in matches_var()
1543 return strcmp(var->name, "gl_ClipDistanceMESA") == 0; in matches_var()
1545 return strcmp(var->name, this->var_name) == 0; in matches_var()
2009 is_varying_var(GLenum shaderType, const ir_variable *var) in is_varying_var() argument
2013 var->mode == ir_var_in && in is_varying_var()
2014 var->explicit_location) { in is_varying_var()
2015 switch (var->location) { in is_varying_var()
2111 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in assign_varying_locations() local
2113 if ((var == NULL) || (var->mode != ir_var_in)) in assign_varying_locations()
2116 if (var->location == -1) { in assign_varying_locations()
2132 "by vertex shader\n.", var->name); in assign_varying_locations()
2138 var->mode = ir_var_auto; in assign_varying_locations()
2139 } else if (is_varying_var(consumer->Type, var)) { in assign_varying_locations()
2143 varying_vectors += count_attribute_slots(var->type); in assign_varying_locations()
2275 ir_variable *const var = ((ir_instruction *) node)->as_variable(); in store_fragdepth_layout() local
2277 if (var == NULL || var->mode != ir_var_out) { in store_fragdepth_layout()
2281 if (strcmp(var->name, "gl_FragDepth") == 0) { in store_fragdepth_layout()
2282 switch (var->depth_layout) { in store_fragdepth_layout()