glsl: rename record_location_offset() -> struct_location_offset()
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 5 Mar 2019 04:55:57 +0000 (15:55 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 6 Mar 2019 02:10:02 +0000 (13:10 +1100)
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>
src/amd/common/ac_nir_to_llvm.c
src/compiler/glsl/gl_nir_lower_samplers_as_deref.c
src/compiler/glsl_types.cpp
src/compiler/glsl_types.h
src/compiler/nir_types.cpp
src/compiler/nir_types.h
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index af7a95137c229cb8df2e0a03fc68d80eb6624036..96dd9c4b96c45eed8e381fcfb0b9cda57f153237 100644 (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");
                        }
index ea32195d42f8a840ca9c284eda543de07a6b2232..27e2d780e7094f12bd3e571628fcc3d81dbb551c 100644 (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));
 
index 24f319dbde285c9294550ed4cc793cb9291e1621..bc9bf1380b269cd9a0dd9170d9ab32797bfeeb74 100644 (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()) {
index 2e858bf4cd791f78c9fe87015154165a918fd0fc..3c675112ec13bca2d8cb3a61f3e5e72b02ba8289 100644 (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
index 5e51dbc2d90a16f3f2bf36452ebeedc97a7d73a9..89028dcaf3de1667a3f428036bf04377c63a7c90 100644 (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
index 68855a65d8e606187af9b4a848d60fa04000fe46..e28c1b45960585f4dc756ed621f416b06590fffd 100644 (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);
index e83432356f1bd542104a2748c6745668ae8bde04..f875c00238f2f4c614686e61055e00cf8998193b 100644 (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;
index ed941e442685978bf3020d97c4921f937466e25a..5b7203542f39fa916d3b5af831dafb8c21f04d8e 100644 (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;
    }