diff options
author | Timothy Arceri <[email protected]> | 2019-03-05 16:07:12 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-03-06 13:10:02 +1100 |
commit | 54522d05065d6ff1b37005c91e503b4d4f11ed67 (patch) | |
tree | 62d28c6db61428cd5b0c9b257005fedd10d35571 /src/compiler/nir | |
parent | e16a27fcf867c8be5ba94470d78f76348f1e8c07 (diff) |
nir: rename glsl_type_is_struct() -> glsl_type_is_struct_or_ifc()
Replace done using:
find ./src -type f -exec sed -i -- \
's/glsl_type_is_struct(/glsl_type_is_struct_or_ifc(/g' {} \;
Acked-by: Karol Herbst <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Acked-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_deref.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_gather_info.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_gather_xfb_info.c | 4 | ||||
-rw-r--r-- | src/compiler/nir/nir_linking_helpers.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_constant_initializers.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_io_arrays_to_elements.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_io_to_scalar.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_lower_vars_to_ssa.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_split_per_member_structs.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_split_var_copies.c | 2 | ||||
-rw-r--r-- | src/compiler/nir/nir_split_vars.c | 6 | ||||
-rw-r--r-- | src/compiler/nir/nir_validate.c | 4 |
13 files changed, 19 insertions, 19 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 253ca5941cb..43edf0a9d36 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -871,7 +871,7 @@ static inline nir_deref_instr * nir_build_deref_struct(nir_builder *build, nir_deref_instr *parent, unsigned index) { - assert(glsl_type_is_struct(parent->type)); + assert(glsl_type_is_struct_or_ifc(parent->type)); nir_deref_instr *deref = nir_deref_instr_create(build->shader, nir_deref_type_struct); @@ -950,7 +950,7 @@ nir_build_deref_follower(nir_builder *b, nir_deref_instr *parent, } case nir_deref_type_struct: - assert(glsl_type_is_struct(parent->type)); + assert(glsl_type_is_struct_or_ifc(parent->type)); assert(glsl_get_length(parent->type) == glsl_get_length(leader_parent->type)); diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c index 7b56611915d..752bd7f8673 100644 --- a/src/compiler/nir/nir_deref.c +++ b/src/compiler/nir/nir_deref.c @@ -152,7 +152,7 @@ struct_type_get_field_offset(const struct glsl_type *struct_type, glsl_type_size_align_func size_align, unsigned field_idx) { - assert(glsl_type_is_struct(struct_type)); + assert(glsl_type_is_struct_or_ifc(struct_type)); unsigned offset = 0; for (unsigned i = 0; i <= field_idx; i++) { unsigned elem_size, elem_align; diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 19438912ff0..f2a209028cc 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -340,7 +340,7 @@ glsl_type_get_sampler_count(const struct glsl_type *type) glsl_type_get_sampler_count(glsl_without_array(type))); } - if (glsl_type_is_struct(type)) { + if (glsl_type_is_struct_or_ifc(type)) { unsigned count = 0; for (int i = 0; i < glsl_get_length(type); i++) count += glsl_type_get_sampler_count(glsl_get_struct_field(type, i)); @@ -361,7 +361,7 @@ glsl_type_get_image_count(const struct glsl_type *type) glsl_type_get_image_count(glsl_without_array(type))); } - if (glsl_type_is_struct(type)) { + if (glsl_type_is_struct_or_ifc(type)) { unsigned count = 0; for (int i = 0; i < glsl_get_length(type); i++) count += glsl_type_get_image_count(glsl_get_struct_field(type, i)); diff --git a/src/compiler/nir/nir_gather_xfb_info.c b/src/compiler/nir/nir_gather_xfb_info.c index ee0546ed39f..c06a7667ab8 100644 --- a/src/compiler/nir/nir_gather_xfb_info.c +++ b/src/compiler/nir/nir_gather_xfb_info.c @@ -42,7 +42,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb, const struct glsl_type *child_type = glsl_get_array_element(type); for (unsigned i = 0; i < length; i++) add_var_xfb_outputs(xfb, var, buffer, location, offset, child_type); - } else if (glsl_type_is_struct(type)) { + } else if (glsl_type_is_struct_or_ifc(type)) { unsigned length = glsl_get_length(type); for (unsigned i = 0; i < length; i++) { const struct glsl_type *child_type = glsl_get_struct_field(type, i); @@ -154,7 +154,7 @@ nir_gather_xfb_info(const nir_shader *shader, void *mem_ctx) add_var_xfb_outputs(xfb, var, var->data.xfb_buffer, &location, &offset, var->type); } else if (is_array_block) { - assert(glsl_type_is_struct(var->interface_type)); + assert(glsl_type_is_struct_or_ifc(var->interface_type)); unsigned aoa_size = glsl_get_aoa_size(var->type); const struct glsl_type *itype = var->interface_type; diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index b387d104d58..02b5ae4b066 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -768,7 +768,7 @@ can_replace_varying(nir_variable *out_var) if (glsl_type_is_array(out_var->type) || glsl_type_is_dual_slot(out_var->type) || glsl_type_is_matrix(out_var->type) || - glsl_type_is_struct(out_var->type)) + glsl_type_is_struct_or_ifc(out_var->type)) return false; /* Limit this pass to scalars for now to keep things simple. Most varyings diff --git a/src/compiler/nir/nir_lower_constant_initializers.c b/src/compiler/nir/nir_lower_constant_initializers.c index f165f220f43..e09eacea033 100644 --- a/src/compiler/nir/nir_lower_constant_initializers.c +++ b/src/compiler/nir/nir_lower_constant_initializers.c @@ -47,7 +47,7 @@ build_constant_load(nir_builder *b, nir_deref_instr *deref, nir_constant *c) nir_store_deref(b, nir_build_deref_array(b, deref, nir_imm_int(b, i)), &load->def, ~0); } - } else if (glsl_type_is_struct(deref->type)) { + } else if (glsl_type_is_struct_or_ifc(deref->type)) { unsigned len = glsl_get_length(deref->type); for (unsigned i = 0; i < len; i++) { build_constant_load(b, nir_build_deref_struct(b, deref, i), diff --git a/src/compiler/nir/nir_lower_io_arrays_to_elements.c b/src/compiler/nir/nir_lower_io_arrays_to_elements.c index 5fbde081476..7f548c8b654 100644 --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c @@ -318,7 +318,7 @@ lower_io_arrays_to_elements(nir_shader *shader, nir_variable_mode mask, * TODO: Add support for struct splitting. */ if ((!glsl_type_is_array(type) && !glsl_type_is_matrix(type))|| - glsl_type_is_struct(glsl_without_array(type))) + glsl_type_is_struct_or_ifc(glsl_without_array(type))) continue; /* Skip builtins */ diff --git a/src/compiler/nir/nir_lower_io_to_scalar.c b/src/compiler/nir/nir_lower_io_to_scalar.c index 60fd61e006c..559d80b214a 100644 --- a/src/compiler/nir/nir_lower_io_to_scalar.c +++ b/src/compiler/nir/nir_lower_io_to_scalar.c @@ -341,7 +341,7 @@ nir_lower_io_to_scalar_early(nir_shader *shader, nir_variable_mode mask) /* Skip types we cannot split */ if (glsl_type_is_matrix(glsl_without_array(var->type)) || - glsl_type_is_struct(glsl_without_array(var->type))) + glsl_type_is_struct_or_ifc(glsl_without_array(var->type))) continue; switch (intr->intrinsic) { diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c index 065280fb9b8..1e7dc8d3579 100644 --- a/src/compiler/nir/nir_lower_vars_to_ssa.c +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c @@ -150,7 +150,7 @@ get_deref_node_recur(nir_deref_instr *deref, switch (deref->deref_type) { case nir_deref_type_struct: - assert(glsl_type_is_struct(parent->type)); + assert(glsl_type_is_struct_or_ifc(parent->type)); assert(deref->strct.index < glsl_get_length(parent->type)); if (parent->children[deref->strct.index] == NULL) { diff --git a/src/compiler/nir/nir_split_per_member_structs.c b/src/compiler/nir/nir_split_per_member_structs.c index 1c148d3d63e..c4de52d1461 100644 --- a/src/compiler/nir/nir_split_per_member_structs.c +++ b/src/compiler/nir/nir_split_per_member_structs.c @@ -53,7 +53,7 @@ member_type(const struct glsl_type *type, unsigned index) assert(glsl_get_explicit_stride(type) == 0); return glsl_array_type(elem, glsl_get_length(type), 0); } else { - assert(glsl_type_is_struct(type)); + assert(glsl_type_is_struct_or_ifc(type)); assert(index < glsl_get_length(type)); return glsl_get_struct_field(type, index); } diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c index 6260a8d7bfa..24d573fd235 100644 --- a/src/compiler/nir/nir_split_var_copies.c +++ b/src/compiler/nir/nir_split_var_copies.c @@ -69,7 +69,7 @@ split_deref_copy_instr(nir_builder *b, assert(dst->type == src->type); if (glsl_type_is_vector_or_scalar(src->type)) { nir_copy_deref(b, dst, src); - } else if (glsl_type_is_struct(src->type)) { + } else if (glsl_type_is_struct_or_ifc(src->type)) { for (unsigned i = 0; i < glsl_get_length(src->type); i++) { split_deref_copy_instr(b, nir_build_deref_struct(b, dst, i), nir_build_deref_struct(b, src, i)); diff --git a/src/compiler/nir/nir_split_vars.c b/src/compiler/nir/nir_split_vars.c index 96b6042e6d9..df059276411 100644 --- a/src/compiler/nir/nir_split_vars.c +++ b/src/compiler/nir/nir_split_vars.c @@ -91,7 +91,7 @@ init_field_for_type(struct field *field, struct field *parent, }; const struct glsl_type *struct_type = glsl_without_array(type); - if (glsl_type_is_struct(struct_type)) { + if (glsl_type_is_struct_or_ifc(struct_type)) { field->num_fields = glsl_get_length(struct_type), field->fields = ralloc_array(state->mem_ctx, struct field, field->num_fields); @@ -143,7 +143,7 @@ split_var_list_structs(nir_shader *shader, * pull all of the variables we plan to split off of the list */ nir_foreach_variable_safe(var, vars) { - if (!glsl_type_is_struct(glsl_without_array(var->type))) + if (!glsl_type_is_struct_or_ifc(glsl_without_array(var->type))) continue; exec_node_remove(&var->node); @@ -205,7 +205,7 @@ split_struct_derefs_impl(nir_function_impl *impl, continue; assert(i > 0); - assert(glsl_type_is_struct(path.path[i - 1]->type)); + assert(glsl_type_is_struct_or_ifc(path.path[i - 1]->type)); assert(path.path[i - 1]->type == glsl_without_array(tail_field->type)); diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 17633323dc3..7150649bcef 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -437,7 +437,7 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state) switch (instr->deref_type) { case nir_deref_type_struct: - validate_assert(state, glsl_type_is_struct(parent->type)); + validate_assert(state, glsl_type_is_struct_or_ifc(parent->type)); validate_assert(state, instr->strct.index < glsl_get_length(parent->type)); validate_assert(state, instr->type == @@ -1017,7 +1017,7 @@ validate_var_decl(nir_variable *var, bool is_global, validate_state *state) if (var->num_members > 0) { const struct glsl_type *without_array = glsl_without_array(var->type); - validate_assert(state, glsl_type_is_struct(without_array)); + validate_assert(state, glsl_type_is_struct_or_ifc(without_array)); validate_assert(state, var->num_members == glsl_get_length(without_array)); validate_assert(state, var->members != NULL); } |