summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-04-21 10:25:42 +0200
committerSamuel Pitoiset <[email protected]>2017-04-21 19:33:32 +0200
commit0c8898dc34b1b8efc12e7491c303249bd081253d (patch)
tree371bfadf373c3e3aea4c6d5e97f24a467b171e21 /src/compiler
parent053912382ee2865da24be4bdd4c21de525519460 (diff)
glsl: make use of glsl_type::is_array()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp2
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp2
-rw-r--r--src/compiler/glsl/link_varyings.cpp2
-rw-r--r--src/compiler/glsl/tests/uniform_initializer_utils.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 88fff861cc5..a4a687f687d 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4712,7 +4712,7 @@ ast_declarator_list::hir(exec_list *instructions,
"invalid type `%s' in empty declaration",
type_name);
} else {
- if (decl_type->base_type == GLSL_TYPE_ARRAY) {
+ if (decl_type->is_array()) {
/* From Section 13.22 (Array Declarations) of the GLSL ES 3.2
* spec:
*
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index 1c84c1be16e..0a39459c925 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -145,7 +145,7 @@ ir_print_visitor::unique_name(ir_variable *var)
static void
print_type(FILE *f, const glsl_type *t)
{
- if (t->base_type == GLSL_TYPE_ARRAY) {
+ if (t->is_array()) {
fprintf(f, "(array ");
print_type(f, t->fields.array);
fprintf(f, " %u)", t->length);
diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index f0df3d60a5c..e6947692aff 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -1678,7 +1678,7 @@ varying_matches::compute_packing_order(const ir_variable *var)
{
const glsl_type *element_type = var->type;
- while (element_type->base_type == GLSL_TYPE_ARRAY) {
+ while (element_type->is_array()) {
element_type = element_type->fields.array;
}
diff --git a/src/compiler/glsl/tests/uniform_initializer_utils.cpp b/src/compiler/glsl/tests/uniform_initializer_utils.cpp
index 2a1a16839b8..9a66ebafbcd 100644
--- a/src/compiler/glsl/tests/uniform_initializer_utils.cpp
+++ b/src/compiler/glsl/tests/uniform_initializer_utils.cpp
@@ -214,7 +214,7 @@ verify_data(gl_constant_value *storage, unsigned storage_array_size,
ir_constant *val, unsigned red_zone_size,
unsigned int boolean_true)
{
- if (val->type->base_type == GLSL_TYPE_ARRAY) {
+ if (val->type->is_array()) {
const glsl_type *const element_type = val->array_elements[0]->type;
for (unsigned i = 0; i < storage_array_size; i++) {