glsl: rename record_location_offset() -> struct_location_offset()

Replace done using:
find ./src -type f -exec sed -i -- \
's/record_location_offset(/struct_location_offset(/g' {} \;

Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Timothy Arceri 2019-03-05 15:55:57 +11:00
parent 88d8c4e290
commit 8294295dbd
8 changed files with 11 additions and 11 deletions

View file

@ -3050,7 +3050,7 @@ static LLVMValueRef visit_interp(struct ac_nir_context *ctx,
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");
@ -3471,7 +3471,7 @@ static LLVMValueRef get_sampler_desc(struct ac_nir_context *ctx,
} 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");
}

View file

@ -104,7 +104,7 @@ remove_struct_derefs_prep(nir_deref_instr **p, char **name,
}
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));

View file

@ -1425,7 +1425,7 @@ glsl_type::component_slots() const
}
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();
@ -1436,7 +1436,7 @@ glsl_type::record_location_offset(unsigned length) const
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()) {

View file

@ -365,7 +365,7 @@ public:
* 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

View file

@ -192,10 +192,10 @@ glsl_get_sampler_coordinate_components(const struct glsl_type *type)
}
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

View file

@ -89,7 +89,7 @@ enum glsl_base_type glsl_get_sampler_result_type(const struct glsl_type *type);
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);

View file

@ -1679,7 +1679,7 @@ calc_sampler_offsets(struct gl_shader_program *prog, ir_dereference *deref,
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;

View file

@ -4088,7 +4088,7 @@ glsl_to_tgsi_visitor::calc_deref_offsets(ir_dereference *tail,
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;
}