From d34f19feba3595b8deec215ad10a6d73b732ea91 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 12 Dec 2018 15:18:04 -0600 Subject: [PATCH] glsl_type: Drop the glsl_get_array_instance C helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It was added in bce6f9987522 even though it's completely redundant with glsl_array_type(). Reviewed-by: Alejandro Piñeiro Reviewed-by: Caio Marcelo de Oliveira Filho --- src/compiler/glsl/gl_nir_lower_samplers_as_deref.c | 2 +- src/compiler/nir/nir_lower_io_arrays_to_elements.c | 3 +-- src/compiler/nir/nir_split_per_member_structs.c | 2 +- src/compiler/nir_types.cpp | 7 ------- src/compiler/nir_types.h | 2 -- 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c index 0c12dea3e90..f3f2dd22df2 100644 --- a/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c +++ b/src/compiler/glsl/gl_nir_lower_samplers_as_deref.c @@ -99,7 +99,7 @@ remove_struct_derefs_prep(nir_deref_instr **p, char **name, remove_struct_derefs_prep(&p[1], name, location, type); - *type = glsl_get_array_instance(*type, length); + *type = glsl_array_type(*type, length); break; } 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 4453eaa1f48..30d53f156ff 100644 --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c @@ -133,8 +133,7 @@ lower_array(nir_builder *b, nir_intrinsic_instr *intr, nir_variable *var, } if (nir_is_per_vertex_io(var, b->shader->info.stage)) { - type = glsl_get_array_instance(type, - glsl_get_length(element->type)); + type = glsl_array_type(type, glsl_get_length(element->type)); } element->type = type; diff --git a/src/compiler/nir/nir_split_per_member_structs.c b/src/compiler/nir/nir_split_per_member_structs.c index 9bad3512863..f649c8f474b 100644 --- a/src/compiler/nir/nir_split_per_member_structs.c +++ b/src/compiler/nir/nir_split_per_member_structs.c @@ -50,7 +50,7 @@ member_type(const struct glsl_type *type, unsigned index) if (glsl_type_is_array(type)) { const struct glsl_type *elem = member_type(glsl_get_array_element(type), index); - return glsl_get_array_instance(elem, glsl_get_length(type)); + return glsl_array_type(elem, glsl_get_length(type)); } else { assert(glsl_type_is_struct(type)); assert(index < glsl_get_length(type)); diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index c8906dc6954..e0e37e2b289 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -59,13 +59,6 @@ glsl_without_array_or_matrix(const glsl_type *type) return type; } -const glsl_type * -glsl_get_array_instance(const glsl_type *type, - unsigned array_size) -{ - return glsl_type::get_array_instance(type, array_size); -} - const glsl_type * glsl_get_struct_field(const glsl_type *type, unsigned index) { diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index fe34cb95837..e7ffad43ad0 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -49,8 +49,6 @@ const struct glsl_type *glsl_get_struct_field(const struct glsl_type *type, const struct glsl_type *glsl_get_array_element(const struct glsl_type *type); const struct glsl_type *glsl_without_array(const struct glsl_type *type); const struct glsl_type *glsl_without_array_or_matrix(const struct glsl_type *type); -const struct glsl_type *glsl_get_array_instance(const struct glsl_type *type, - unsigned array_size); const struct glsl_type *glsl_get_column_type(const struct glsl_type *type); -- 2.30.2