summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-04-21 10:32:39 +0200
committerSamuel Pitoiset <[email protected]>2017-04-21 19:33:36 +0200
commit64db02b5fabcf740b353904b05bd9b9e8c713b76 (patch)
tree41640b2ede731c321e5b33a0e057e76c84398138 /src/compiler
parentcd78ab55d0afefa501929366205443e15ed85495 (diff)
glsl: make use of glsl_type::is_record()
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/hir_field_selection.cpp3
-rw-r--r--src/compiler/glsl/ir.cpp2
-rw-r--r--src/compiler/glsl/ir_print_visitor.cpp3
3 files changed, 3 insertions, 5 deletions
diff --git a/src/compiler/glsl/hir_field_selection.cpp b/src/compiler/glsl/hir_field_selection.cpp
index aa1808afa15..9f23643fd02 100644
--- a/src/compiler/glsl/hir_field_selection.cpp
+++ b/src/compiler/glsl/hir_field_selection.cpp
@@ -46,8 +46,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
YYLTYPE loc = expr->get_location();
if (op->type->is_error()) {
/* silently propagate the error */
- } else if (op->type->base_type == GLSL_TYPE_STRUCT
- || op->type->is_interface()) {
+ } else if (op->type->is_record() || op->type->is_interface()) {
result = new(ctx) ir_dereference_record(op,
expr->primary_expression.identifier);
diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 2bbc7a1cf72..b5c1fa33919 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1237,7 +1237,7 @@ ir_constant::has_value(const ir_constant *c) const
return true;
}
- if (this->type->base_type == GLSL_TYPE_STRUCT) {
+ if (this->type->is_record()) {
const exec_node *a_node = this->components.get_head_raw();
const exec_node *b_node = c->components.get_head_raw();
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
index 0a39459c925..6c1c86a5828 100644
--- a/src/compiler/glsl/ir_print_visitor.cpp
+++ b/src/compiler/glsl/ir_print_visitor.cpp
@@ -149,8 +149,7 @@ print_type(FILE *f, const glsl_type *t)
fprintf(f, "(array ");
print_type(f, t->fields.array);
fprintf(f, " %u)", t->length);
- } else if ((t->base_type == GLSL_TYPE_STRUCT)
- && !is_gl_identifier(t->name)) {
+ } else if (t->is_record() && !is_gl_identifier(t->name)) {
fprintf(f, "%s@%p", t->name, (void *) t);
} else {
fprintf(f, "%s", t->name);