LLVMValueRef offset;
unsigned sidx = deref_instr->strct.index;
deref_instr = nir_src_as_deref(deref_instr->parent);
- offset = LLVMConstInt(ctx->ac.i32, glsl_get_record_location_offset(deref_instr->type, sidx), false);
+ offset = LLVMConstInt(ctx->ac.i32, glsl_get_struct_location_offset(deref_instr->type, sidx), false);
attrib_idx = LLVMBuildAdd(ctx->ac.builder, attrib_idx, offset, "");
} else {
unreachable("Unsupported deref type");
} else if (deref_instr->deref_type == nir_deref_type_struct) {
unsigned sidx = deref_instr->strct.index;
deref_instr = nir_src_as_deref(deref_instr->parent);
- constant_index += glsl_get_record_location_offset(deref_instr->type, sidx);
+ constant_index += glsl_get_struct_location_offset(deref_instr->type, sidx);
} else {
unreachable("Unsupported deref type");
}
}
case nir_deref_type_struct: {
- *location += glsl_get_record_location_offset(cur->type, next->strct.index);
+ *location += glsl_get_struct_location_offset(cur->type, next->strct.index);
ralloc_asprintf_append(name, ".%s",
glsl_get_struct_elem_name(cur->type, next->strct.index));
}
unsigned
-glsl_type::record_location_offset(unsigned length) const
+glsl_type::struct_location_offset(unsigned length) const
{
unsigned offset = 0;
const glsl_type *t = this->without_array();
const glsl_type *st = t->fields.structure[i].type;
const glsl_type *wa = st->without_array();
if (wa->is_struct()) {
- unsigned r_offset = wa->record_location_offset(wa->length);
+ unsigned r_offset = wa->struct_location_offset(wa->length);
offset += st->is_array() ?
st->arrays_of_arrays_size() * r_offset : r_offset;
} else if (st->is_array() && st->fields.array->is_array()) {
* For the initial call, length is the index of the member to find the
* offset for.
*/
- unsigned record_location_offset(unsigned length) const;
+ unsigned struct_location_offset(unsigned length) const;
/**
* Calculate the number of unique values from glGetUniformLocation for the
}
unsigned
-glsl_get_record_location_offset(const struct glsl_type *type,
+glsl_get_struct_location_offset(const struct glsl_type *type,
unsigned length)
{
- return type->record_location_offset(length);
+ return type->struct_location_offset(length);
}
bool
unsigned glsl_get_sampler_target(const struct glsl_type *type);
int glsl_get_sampler_coordinate_components(const struct glsl_type *type);
-unsigned glsl_get_record_location_offset(const struct glsl_type *type,
+unsigned glsl_get_struct_location_offset(const struct glsl_type *type,
unsigned length);
unsigned glsl_atomic_size(const struct glsl_type *type);
ir_dereference_record *deref_record = deref->as_dereference_record();
unsigned field_index = deref_record->field_idx;
*location +=
- deref_record->record->type->record_location_offset(field_index);
+ deref_record->record->type->struct_location_offset(field_index);
calc_sampler_offsets(prog, deref_record->record->as_dereference(),
offset, array_elements, location);
break;
calc_deref_offsets(deref_record->record->as_dereference(), array_elements, index, indirect, location);
assert(field_index >= 0);
- *location += struct_type->record_location_offset(field_index);
+ *location += struct_type->struct_location_offset(field_index);
break;
}